From f67df4f9ab1d7dc471e4156ef0116785f21fb78f Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Tue, 20 Mar 2018 10:29:55 +0100 Subject: [PATCH] Clang: Check that follow symbol QFuture is not cancelled We can't take QFuture result if it's cancelled. Change-Id: I493e083c0d35e753d1b2616caf2081f472393e34 Reviewed-by: David Schulz --- src/plugins/clangcodemodel/clangfollowsymbol.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/clangcodemodel/clangfollowsymbol.cpp b/src/plugins/clangcodemodel/clangfollowsymbol.cpp index 41872a4f515..48eca952b83 100644 --- a/src/plugins/clangcodemodel/clangfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangfollowsymbol.cpp @@ -129,6 +129,8 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data, QObject::connect(&m_watcher, &FutureSymbolWatcher::finished, [=, watcher=&m_watcher, callback=std::move(processLinkCallback)]() mutable { + if (watcher->isCanceled()) + return callback(Utils::Link()); CppTools::SymbolInfo result = watcher->result(); // We did not fail but the result is empty if (result.fileName.isEmpty()) {