forked from qt-creator/qt-creator
Android: Don't crash when dis- and reconnecting phone via USB
When ADB signals a change about the list of connected devices, the whole build/run steps tree gets deleted and recreated. The AndroidBuildApkStep is a part of that tree and starts one or more "keytool" processes on creation/init. They were started with their own event loop. Those synthetic event loops caused a change in order of deletion which led to crashes with obscure backtraces. This change removes the event loop creation from "keytool" calls. The crash is avoided. The calls take ~0.5 seconds. The short UI freeze should be an acceptable hotfix trade-off for a crash in QtC13. If 0.5 seconds freeze seem too much, a better fix could be done in QtC 14. Fixes: QTCREATORBUG-30645 Fixes: QTCREATORBUG-30770 Change-Id: I8842dc87023142ae75572bf255c7f1ec808d9bab Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -275,7 +275,7 @@ void AndroidCreateKeystoreCertificate::buttonBoxAccepted()
|
||||
Process genKeyCertProc;
|
||||
genKeyCertProc.setCommand(command);
|
||||
using namespace std::chrono_literals;
|
||||
genKeyCertProc.runBlocking(15s, EventLoopMode::On);
|
||||
genKeyCertProc.runBlocking(15s);
|
||||
|
||||
if (genKeyCertProc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
QMessageBox::critical(this, Tr::tr("Error"),
|
||||
|
||||
Reference in New Issue
Block a user