diff --git a/src/plugins/clangcodemodel/clangdswitchdecldef.cpp b/src/plugins/clangcodemodel/clangdswitchdecldef.cpp index 7733516655f..a60395292c1 100644 --- a/src/plugins/clangcodemodel/clangdswitchdecldef.cpp +++ b/src/plugins/clangcodemodel/clangdswitchdecldef.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -68,6 +69,7 @@ ClangdSwitchDeclDef::ClangdSwitchDeclDef(ClangdClient *client, TextDocument *doc [this](const DocumentUri &uri, const DocumentSymbolsResult &symbols) { if (uri != d->uri) return; + d->client->documentSymbolCache()->disconnect(this); d->docSymbols = symbols; if (d->ast) d->handleDeclDefSwitchReplies(); @@ -108,7 +110,7 @@ void ClangdSwitchDeclDef::emitDone() return; d->done = true; - emit done(); + QMetaObject::invokeMethod(this, &ClangdSwitchDeclDef::done, Qt::QueuedConnection); } std::optional ClangdSwitchDeclDef::Private::getFunctionNode() const