forked from qt-creator/qt-creator
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 <david.schulz@qt.io>
This commit is contained in:
@@ -129,6 +129,8 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
|
|||||||
|
|
||||||
QObject::connect(&m_watcher, &FutureSymbolWatcher::finished,
|
QObject::connect(&m_watcher, &FutureSymbolWatcher::finished,
|
||||||
[=, watcher=&m_watcher, callback=std::move(processLinkCallback)]() mutable {
|
[=, watcher=&m_watcher, callback=std::move(processLinkCallback)]() mutable {
|
||||||
|
if (watcher->isCanceled())
|
||||||
|
return callback(Utils::Link());
|
||||||
CppTools::SymbolInfo result = watcher->result();
|
CppTools::SymbolInfo result = watcher->result();
|
||||||
// We did not fail but the result is empty
|
// We did not fail but the result is empty
|
||||||
if (result.fileName.isEmpty()) {
|
if (result.fileName.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user