summaryrefslogtreecommitdiff
path: root/src/plugins/autotest/testcodeparser.cpp
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2016-06-20 07:03:55 +0200
committerChristian Stenger <christian.stenger@qt.io>2016-06-20 10:50:28 +0000
commit72e6dd2ab102ddb45ab3de12f61ab1d21c41e6eb (patch)
tree961d877d0468eba2fbabbf81ddceb10b2fc8b51a /src/plugins/autotest/testcodeparser.cpp
parentcfc724e7095af17e7aadcc3881a443104800402f (diff)
downloadqt-creator-72e6dd2ab102ddb45ab3de12f61ab1d21c41e6eb.tar.gz
AutoTest: Avoid fetching WorkingCopy from multiple threads
Instead fetch it once before starting asynchronous processing and accept that current state of the WorkingCopy might be not completely up to date. This avoids a crash that might happen when the code model tries to update the WorkingCopy while the test code parser fetches information of the WorkingCopy. Change-Id: I2a893bc8814090361305657ed3c3d772c7bf07d5 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/autotest/testcodeparser.cpp')
-rw-r--r--src/plugins/autotest/testcodeparser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp
index 584d622527..857c16b25f 100644
--- a/src/plugins/autotest/testcodeparser.cpp
+++ b/src/plugins/autotest/testcodeparser.cpp
@@ -76,6 +76,7 @@ TestCodeParser::TestCodeParser(TestTreeModel *parent)
this, [this] (int index) {
emit testParseResultReady(m_futureWatcher.resultAt(index));
});
+ connect(this, &TestCodeParser::parsingFinished, this, &TestCodeParser::releaseParserInternals);
}
TestCodeParser::~TestCodeParser()
@@ -425,5 +426,11 @@ void TestCodeParser::onPartialParsingFinished()
}
}
+void TestCodeParser::releaseParserInternals()
+{
+ for (ITestParser *parser : m_testCodeParsers)
+ parser->release();
+}
+
} // namespace Internal
} // namespace Autotest