Skip to content
Snippets Groups Projects
Commit e78763bb authored by ck's avatar ck
Browse files

Maemo: Introduce automatic cleanup for another pointer.

parent f196700e
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <ne7ssh.h> #include <ne7ssh.h>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QScopedPointer>
#include <QtCore/QStringBuilder> #include <QtCore/QStringBuilder>
#include <cstdio> #include <cstdio>
...@@ -132,12 +133,12 @@ void MaemoInteractiveSshConnection::runCommand(const QString &command) ...@@ -132,12 +133,12 @@ void MaemoInteractiveSshConnection::runCommand(const QString &command)
const char * const error = lastError(); const char * const error = lastError();
if (error) if (error)
throw MaemoSshException(tr("SSH error: %1").arg(error)); throw MaemoSshException(tr("SSH error: %1").arg(error));
const char * const output = ssh.readAndReset(channel(), alloc); QScopedPointer<char, QScopedPointerArrayDeleter<char> >
if (output) { output(ssh.readAndReset(channel(), alloc));
emit remoteOutput(QString::fromUtf8(output)); if (output.data()) {
emit remoteOutput(QString::fromUtf8(output.data()));
if (!done) if (!done)
done = strstr(output, m_prompt) != 0; done = strstr(output.data(), m_prompt) != 0;
delete[] output;
} }
} while (!done && !stopRequested()); } while (!done && !stopRequested());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment