forked from qt-creator/qt-creator
Maemo: Introduce automatic cleanup for another pointer.
This commit is contained in:
@@ -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)
|
|||||||
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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user