QmlJSEditor: fix crash after document reload

Clean up all marks in the document destructor, to prevent accessing
already deleted member in a TextMark callback.

Task-number: QTCREATORBUG-20199
Change-Id: Ica996ea393b9ae636c731f009a6d39552ff35e26
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
David Schulz
2018-04-10 13:57:17 +02:00
parent 8441bb0933
commit a2c362af31

View File

@@ -501,6 +501,10 @@ QmlJSEditorDocumentPrivate::~QmlJSEditorDocumentPrivate()
{ {
m_semanticInfoUpdater->abort(); m_semanticInfoUpdater->abort();
m_semanticInfoUpdater->wait(); m_semanticInfoUpdater->wait();
// clean up all marks, otherwise a callback could try to access deleted members.
// see QTCREATORBUG-20199
cleanDiagnosticMarks();
cleanSemanticMarks();
} }
void QmlJSEditorDocumentPrivate::invalidateFormatterCache() void QmlJSEditorDocumentPrivate::invalidateFormatterCache()