From 967b1d237bf3684e7c2f5ca7139be90023f3b2b9 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 24 Feb 2022 11:11:07 +0100 Subject: [PATCH] ClangCodeModel: remove ClangdTextMark safety net Since all text mark created by the diagnostic manager get deleted properly on destruction now, there is no need to react on the client destruction in ClangdTextMark. Task-number: QTCREATORBUG-26585 Change-Id: Ifb9b8546c8f0d94debdcf2c8de6081e4e731cfab Reviewed-by: Christian Kandeler --- src/plugins/clangcodemodel/clangtextmark.cpp | 10 ---------- src/plugins/clangcodemodel/clangtextmark.h | 3 --- 2 files changed, 13 deletions(-) diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index 77eabc2f04d..16fda9accba 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -406,11 +406,6 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath, ClangDiagnosticManager::addTask(m_diagnostic); } - m_clientDeleted = QObject::connect(client, &QObject::destroyed, [this] (){ - QTC_ASSERT_STRING("ClangdClient deleted before TextMark"); - delete this; - }); - // Copy to clipboard action QVector actions; QAction *action = new QAction(); @@ -438,11 +433,6 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath, setActions(actions); } -ClangdTextMark::~ClangdTextMark() -{ - QObject::disconnect(m_clientDeleted); -} - bool ClangdTextMark::addToolTipContent(QLayout *target) const { const auto canApplyFixIt = [c = m_client, diag = m_lspDiagnostic, fp = fileName()] { diff --git a/src/plugins/clangcodemodel/clangtextmark.h b/src/plugins/clangcodemodel/clangtextmark.h index 8ab892e1bcf..15b97ab32f1 100644 --- a/src/plugins/clangcodemodel/clangtextmark.h +++ b/src/plugins/clangcodemodel/clangtextmark.h @@ -73,7 +73,6 @@ public: ClangdTextMark(const ::Utils::FilePath &filePath, const LanguageServerProtocol::Diagnostic &diagnostic, const LanguageClient::Client *client); - ~ClangdTextMark(); private: bool addToolTipContent(QLayout *target) const override; @@ -81,8 +80,6 @@ private: const LanguageServerProtocol::Diagnostic m_lspDiagnostic; const ClangBackEnd::DiagnosticContainer m_diagnostic; const QPointer m_client; - - QMetaObject::Connection m_clientDeleted; }; } // namespace Internal