forked from qt-creator/qt-creator
TextEditor: fix crash on reload
Since TextDocument::openImpl potentially processes events it could delete TextMarks. So tracking them in TextDocument::reload can be considered unsafe. Track them in TextDocumentLayout instead and remove the tracked mark if it gets deleted while reloading the document. Task-number: QTCREATORBUG-29004 Change-Id: I9d0478e9c763b49f145c1bbaeed1a0b602757014 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -245,7 +245,8 @@ public:
|
||||
QRectF blockBoundingRect(const QTextBlock &block) const override;
|
||||
|
||||
TextMarks documentClosing();
|
||||
void documentReloaded(TextMarks marks, TextDocument *baseextDocument);
|
||||
void documentAboutToReload();
|
||||
void documentReloaded(TextDocument *baseextDocument);
|
||||
void updateMarksLineNumber();
|
||||
void updateMarksBlock(const QTextBlock &block);
|
||||
void scheduleUpdate();
|
||||
@@ -253,6 +254,8 @@ public:
|
||||
|
||||
private:
|
||||
bool m_updateScheduled = false;
|
||||
TextMarks m_reloadMarks;
|
||||
void resetReloadMarks();
|
||||
|
||||
signals:
|
||||
void updateExtraArea();
|
||||
|
||||
Reference in New Issue
Block a user