Commit 6b2d6e79 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppEditor: Cancel waiting for use selections if revision changed

Not sure whether this can happen at all, but if it can, we should not
make the UI unusable.

Change-Id: I1a40630d0c1f057e20a33b2c755e1fd5aea0b003
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent 4335f118
......@@ -94,6 +94,7 @@ void CppUseSelectionsUpdater::update(CallType callType)
m_runnerWatcher->setFuture(cppEditorDocument->cursorInfo(params));
} else { // synchronous case
const int startRevision = cppEditorDocument->document()->revision();
QFuture<CursorInfo> future = cppEditorDocument->cursorInfo(params);
// QFuture::waitForFinished seems to block completely, not even
......@@ -102,6 +103,7 @@ void CppUseSelectionsUpdater::update(CallType callType)
if (future.isCanceled())
return;
QTC_ASSERT(startRevision == cppEditorDocument->document()->revision(), return);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment