forked from qt-creator/qt-creator
Fix crash when pressing stop button
Change-Id: If1902153404c49516cf4e535655dbbb5a8135b1c Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
committed by
Daniel Teske
parent
b7ba74d80c
commit
0f026bd9d2
@@ -71,7 +71,7 @@ void AndroidRunControl::start()
|
|||||||
|
|
||||||
RunControl::StopResult AndroidRunControl::stop()
|
RunControl::StopResult AndroidRunControl::stop()
|
||||||
{
|
{
|
||||||
m_runner->stop();
|
m_runner->stop(true);
|
||||||
return StoppedSynchronously;
|
return StoppedSynchronously;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,7 +68,7 @@ AndroidRunner::AndroidRunner(QObject *parent, AndroidRunConfiguration *runConfig
|
|||||||
|
|
||||||
AndroidRunner::~AndroidRunner()
|
AndroidRunner::~AndroidRunner()
|
||||||
{
|
{
|
||||||
stop();
|
stop(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidRunner::checkPID()
|
void AndroidRunner::checkPID()
|
||||||
@@ -232,7 +232,7 @@ void AndroidRunner::startLogcat()
|
|||||||
emit remoteProcessStarted(5039);
|
emit remoteProcessStarted(5039);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidRunner::stop()
|
void AndroidRunner::stop(bool async)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
m_adbLogcatProcess.terminate();
|
m_adbLogcatProcess.terminate();
|
||||||
@@ -240,7 +240,10 @@ void AndroidRunner::stop()
|
|||||||
m_checkPIDTimer.stop();
|
m_checkPIDTimer.stop();
|
||||||
if (m_processPID == -1)
|
if (m_processPID == -1)
|
||||||
return; // don't emit another signal
|
return; // don't emit another signal
|
||||||
QtConcurrent::run(this, &AndroidRunner::asyncStop);
|
if (async)
|
||||||
|
QtConcurrent::run(this, &AndroidRunner::asyncStop);
|
||||||
|
else
|
||||||
|
asyncStop();
|
||||||
}
|
}
|
||||||
void AndroidRunner::asyncStop()
|
void AndroidRunner::asyncStop()
|
||||||
{
|
{
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop(bool async);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void remoteProcessStarted(int gdbServerPort = -1, int qmlPort = -1);
|
void remoteProcessStarted(int gdbServerPort = -1, int qmlPort = -1);
|
||||||
|
Reference in New Issue
Block a user