summaryrefslogtreecommitdiff
path: root/src/plugins/autotest/quick/quicktestparser.cpp
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2016-07-08 12:53:57 +0200
committerChristian Stenger <christian.stenger@qt.io>2016-07-15 09:18:01 +0000
commit48b2af5e773a39e8e3a342f1d082ff6bc1a96b54 (patch)
treef956bf3889a9a6d864bf5518e82bd5b6ea51baef /src/plugins/autotest/quick/quicktestparser.cpp
parente70adf820ee42578f4a412572bedf3b745492619 (diff)
downloadqt-creator-48b2af5e773a39e8e3a342f1d082ff6bc1a96b54.tar.gz
AutoTest: Cancel possible running tasks on shutdown
If tasks are running while shutting down we might end up in a crash, so cancel all tasks and handle possible invalid accesses of the current running processing. Change-Id: I69f7cac5f44390e322fa301af6d6794270c95c2a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/autotest/quick/quicktestparser.cpp')
-rw-r--r--src/plugins/autotest/quick/quicktestparser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp
index 7c0074ff73..49ad52c671 100644
--- a/src/plugins/autotest/quick/quicktestparser.cpp
+++ b/src/plugins/autotest/quick/quicktestparser.cpp
@@ -202,7 +202,8 @@ static bool handleQtQuickTest(QFutureInterface<TestParseResultPtr> futureInterfa
const QString cppFileName = document->fileName();
QList<CppTools::ProjectPart::Ptr> ppList = modelManager->projectPart(cppFileName);
- QTC_ASSERT(!ppList.isEmpty(), return false);
+ if (ppList.isEmpty()) // happens if shutting down while parsing
+ return false;
const QString &proFile = ppList.at(0)->projectFile;
const QString srcDir = quickTestSrcDir(modelManager, cppFileName);