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

@@ -56,7 +56,7 @@ private:
QString m_launchedAVDName;
QThread m_thread;
QTimer m_checkAVDTimer;
QScopedPointer<AndroidRunnerWorker> m_worker;
AndroidRunnerWorker *m_worker = nullptr;
QPointer<ProjectExplorer::Target> m_target;
Utils::Port m_debugServerPort;
QUrl m_qmlServer;