forked from qt-creator/qt-creator
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:
@@ -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()
|
||||||
|
Reference in New Issue
Block a user