From 5b95d912944a37a0f97a3cf1108e00b7de710e66 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 26 Jun 2018 08:20:42 +0300 Subject: [PATCH] TextEditor: Fix crash Happens when closing an editor while tooltip processing is in progress. Change-Id: I023f62ab6ba1e8b1bbe207da08c1e526fb99430a Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 71818d1e937..8ad2cacf564 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -351,6 +351,8 @@ public: void onHandlerFinished(int documentRevision, int position, int priority) { + if (!m_widget) + return; QTC_ASSERT(m_currentHandlerIndex < m_handlers.size(), return); QTC_ASSERT(documentRevision == m_documentRevision, return); QTC_ASSERT(position == m_position, return); @@ -376,7 +378,7 @@ public: } private: - TextEditorWidget *m_widget = nullptr; + QPointer m_widget; const QList &m_handlers; struct LastHandlerInfo {