Android: Fix a crash on Creator shutdown during app startup

The AndroidRunnerWorker lives in a separate thread created
by AndroidRunner. Thus, we can't delete it directly from
the AndroidRunner's d'tor. Instead, we connect to QThread's
finished() signal and delete the worker later.

Make m_pidRunner a child of AndroidRunnerWorker so that
it's moved together with its parent to the other thread.

Change-Id: I5c3723315ee5183fa8451f0706311b14f173dca1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Jarek Kobus
2024-07-11 15:52:28 +02:00
parent 77fa73c524
commit eca1fa3b2f
3 changed files with 12 additions and 10 deletions

View File

@@ -203,6 +203,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit());
m_useAppParamsForQmlDebugger = version->qtVersion() >= QVersionNumber(5, 12);
m_pidRunner.setParent(this); // Move m_pidRunner object together with *this into a separate thread.
}
AndroidRunnerWorker::~AndroidRunnerWorker()