forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -199,7 +199,10 @@ static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
|
||||
parseResult->displayName = testCaseName;
|
||||
parseResult->line = line;
|
||||
parseResult->column = column;
|
||||
parseResult->proFile = modelManager->projectPart(fileName).first()->projectFile;
|
||||
QList<CppTools::ProjectPart::Ptr> projectParts = modelManager->projectPart(fileName);
|
||||
if (projectParts.isEmpty()) // happens if shutting down while parsing
|
||||
return false;
|
||||
parseResult->proFile = projectParts.first()->projectFile;
|
||||
QMap<QString, TestCodeLocationAndType>::ConstIterator it = testFunctions.begin();
|
||||
const QMap<QString, TestCodeLocationAndType>::ConstIterator end = testFunctions.end();
|
||||
for ( ; it != end; ++it) {
|
||||
|
||||
Reference in New Issue
Block a user