CppEditor: Cancel runner in ~CppUseSelectionsUpdater

...otherwise an already destructed QTextDocument might be accessed in
the ClangCodeModel::Internal::IpcReceiver::references.

Task-number: QTCREATORBUG-18459
Change-Id: I1868b2fd3a64341794f83eea6c4eeb7c2c1af812
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-06-27 09:21:46 +02:00
parent 22829c1906
commit d870bab95c
4 changed files with 11 additions and 3 deletions

View File

@@ -49,6 +49,12 @@ CppUseSelectionsUpdater::CppUseSelectionsUpdater(TextEditor::TextEditorWidget *e
connect(&m_timer, &QTimer::timeout, this, [this]() { update(); });
}
CppUseSelectionsUpdater::~CppUseSelectionsUpdater()
{
if (m_runnerWatcher)
m_runnerWatcher->cancel();
}
void CppUseSelectionsUpdater::scheduleUpdate()
{
m_timer.start();