diff options
author | Eike Ziller <eike.ziller@qt.io> | 2022-05-06 11:40:19 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2022-05-06 10:44:39 +0000 |
commit | 2e0633907f3dbb3035bc7204194d2c20c7d42796 (patch) | |
tree | a480bc1c8ccaa2342e7b89c7c30d895548ddfbeb | |
parent | aed87f257ab896641b0b21dc56116b1597de9848 (diff) |
VCS: Fix possible crash on shutdown
Similar to how it is done for the WindowTitleAdditionHandler and
SessionTitleHandler.
Fixes: QTCREATORBUG-27048
Change-Id: Ic8c140b99c7c6edbc43bed5f1b9275b4af5ce831
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r-- | src/plugins/vcsbase/vcsbaseplugin.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index b058600d0b..b371c8b2f6 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -197,6 +197,7 @@ class StateListener : public QObject public: explicit StateListener(QObject *parent); + ~StateListener(); static QString windowTitleVcsTopic(const QString &filePath); @@ -221,10 +222,14 @@ StateListener::StateListener(QObject *parent) : QObject(parent) connect(SessionManager::instance(), &SessionManager::startupProjectChanged, this, &StateListener::slotStateChanged); - EditorManager::setWindowTitleVcsTopicHandler(&StateListener::windowTitleVcsTopic); } +StateListener::~StateListener() +{ + EditorManager::setWindowTitleVcsTopicHandler({}); +} + QString StateListener::windowTitleVcsTopic(const QString &filePath) { FilePath searchPath; |