diff options
author | David Schulz <david.schulz@qt.io> | 2018-04-10 13:57:17 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2018-04-11 08:18:49 +0000 |
commit | a2c362af319af77864456005046ebd09d3ceb41f (patch) | |
tree | a77188419ab4328b31bcdd22cce792c8df1cc24b /src/plugins/qmljseditor | |
parent | 8441bb0933bb1d4765540443226252b6a1e1b297 (diff) | |
download | qt-creator-a2c362af319af77864456005046ebd09d3ceb41f.tar.gz |
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>
Diffstat (limited to 'src/plugins/qmljseditor')
-rw-r--r-- | src/plugins/qmljseditor/qmljseditordocument.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 66fa6da393..4ca53d2ce3 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -501,6 +501,10 @@ QmlJSEditorDocumentPrivate::~QmlJSEditorDocumentPrivate() { m_semanticInfoUpdater->abort(); m_semanticInfoUpdater->wait(); + // clean up all marks, otherwise a callback could try to access deleted members. + // see QTCREATORBUG-20199 + cleanDiagnosticMarks(); + cleanSemanticMarks(); } void QmlJSEditorDocumentPrivate::invalidateFormatterCache() |