Fix crash when pressing stop button

Change-Id: If1902153404c49516cf4e535655dbbb5a8135b1c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
BogDan Vatra
2012-12-07 19:53:32 +02:00
committed by Daniel Teske
parent b7ba74d80c
commit 0f026bd9d2
3 changed files with 8 additions and 5 deletions

View File

@@ -68,7 +68,7 @@ AndroidRunner::AndroidRunner(QObject *parent, AndroidRunConfiguration *runConfig
AndroidRunner::~AndroidRunner()
{
stop();
stop(false);
}
void AndroidRunner::checkPID()
@@ -232,7 +232,7 @@ void AndroidRunner::startLogcat()
emit remoteProcessStarted(5039);
}
void AndroidRunner::stop()
void AndroidRunner::stop(bool async)
{
QMutexLocker locker(&m_mutex);
m_adbLogcatProcess.terminate();
@@ -240,7 +240,10 @@ void AndroidRunner::stop()
m_checkPIDTimer.stop();
if (m_processPID == -1)
return; // don't emit another signal
QtConcurrent::run(this, &AndroidRunner::asyncStop);
if (async)
QtConcurrent::run(this, &AndroidRunner::asyncStop);
else
asyncStop();
}
void AndroidRunner::asyncStop()
{