summaryrefslogtreecommitdiff
path: root/src/libs/utils/buildablehelperlibrary.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-05-26 12:12:01 +0200
committerTobias Hunger <tobias.hunger@qt.io>2016-05-26 11:50:03 +0000
commit5d3823ac4727fb426915b468a031346e5f9ab929 (patch)
tree5ce95d25b8028fa82174d0a0f41bdc3b53a66e75 /src/libs/utils/buildablehelperlibrary.cpp
parent179153829a7bf2d72ffa290b2e1da4bdb58eea90 (diff)
downloadqt-creator-5d3823ac4727fb426915b468a031346e5f9ab929.tar.gz
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>
Diffstat (limited to 'src/libs/utils/buildablehelperlibrary.cpp')
-rw-r--r--src/libs/utils/buildablehelperlibrary.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp
index a57c829a22..357bc2fea2 100644
--- a/src/libs/utils/buildablehelperlibrary.cpp
+++ b/src/libs/utils/buildablehelperlibrary.cpp
@@ -43,7 +43,7 @@ QString BuildableHelperLibrary::qtChooserToQmakePath(const QString &path)
const QString toolDir = QLatin1String("QTTOOLDIR=\"");
SynchronousProcess proc;
proc.setTimeoutS(1);
- SynchronousProcessResponse response = proc.run(path, QStringList(QLatin1String("-print-env")));
+ SynchronousProcessResponse response = proc.runBlocking(path, QStringList(QLatin1String("-print-env")));
if (response.result != SynchronousProcessResponse::Finished)
return QString();
const QString output = response.stdOut;
@@ -104,7 +104,7 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath)
SynchronousProcess qmake;
qmake.setTimeoutS(5);
- SynchronousProcessResponse response = qmake.run(qmakePath, QStringList(QLatin1String("--version")));
+ SynchronousProcessResponse response = qmake.runBlocking(qmakePath, QStringList(QLatin1String("--version")));
if (response.result != SynchronousProcessResponse::Finished) {
qWarning() << response.exitMessage(qmakePath, 5);
return QString();