Use SynchronousProcess::runBlocking

Use SynchronousProcess::runBlocking in favor of SychronousProcess::run.
This avoid nested event loops which can produce really strange crashes
if not use carefully.

This patch only converts those processes that have a timeout of less
than 5 seconds or use the default timeout.

Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Tobias Hunger
2016-05-26 12:12:01 +02:00
parent 179153829a
commit 5d3823ac47
14 changed files with 23 additions and 22 deletions

View File

@@ -228,8 +228,8 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
SynchronousProcess lldbInfo;
lldbInfo.setTimeoutS(2);
SynchronousProcessResponse response
= lldbInfo.run(QLatin1String("xcrun"), QStringList() << QLatin1String("--find")
<< QLatin1String("lldb"));
= lldbInfo.runBlocking(QLatin1String("xcrun"), QStringList() << QLatin1String("--find")
<< QLatin1String("lldb"));
if (response.result == Utils::SynchronousProcessResponse::Finished) {
QString lPath = response.allOutput();
if (!lPath.isEmpty()) {