ClangModelManagerSupport: Skip explicit call to waitForFinished()

This is done by the FutureSynchronizer d'tor, so no need to call
it explicitly. Move the FutureSynchronizer as the last field of
ClangModelManagerSupport so that its d'tor is executed first.

Change-Id: Id38b8ec08579be8e4ade99ecadb511850ff37f8c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2024-02-26 13:12:45 +01:00
parent b5e03b8fe2
commit 97ec97ff27
2 changed files with 2 additions and 5 deletions

View File

@@ -293,10 +293,7 @@ ClangModelManagerSupport::ClangModelManagerSupport()
new ClangdQuickFixFactory(); // memory managed by CppEditor::g_cppQuickFixFactories new ClangdQuickFixFactory(); // memory managed by CppEditor::g_cppQuickFixFactories
} }
ClangModelManagerSupport::~ClangModelManagerSupport() ClangModelManagerSupport::~ClangModelManagerSupport() = default;
{
m_generatorSynchronizer.waitForFinished();
}
void ClangModelManagerSupport::followSymbol(const CursorInEditor &data, void ClangModelManagerSupport::followSymbol(const CursorInEditor &data,
const LinkHandler &processLinkCallback, const LinkHandler &processLinkCallback,

View File

@@ -94,10 +94,10 @@ private:
void scheduleClientRestart(ClangdClient *client); void scheduleClientRestart(ClangdClient *client);
static ClangdClient *clientWithProject(const ProjectExplorer::Project *project); static ClangdClient *clientWithProject(const ProjectExplorer::Project *project);
Utils::FutureSynchronizer m_generatorSynchronizer;
QList<QPointer<ClangdClient>> m_clientsToRestart; QList<QPointer<ClangdClient>> m_clientsToRestart;
QTimer * const m_clientRestartTimer; QTimer * const m_clientRestartTimer;
QHash<Utils::FilePath, QString> m_potentialShadowDocuments; QHash<Utils::FilePath, QString> m_potentialShadowDocuments;
Utils::FutureSynchronizer m_generatorSynchronizer; // Keep me last
}; };
} // namespace Internal } // namespace Internal