diff --git a/src/editor/kmcomposerwin.cpp b/src/editor/kmcomposerwin.cpp index ecc5477fc..a97b8b7c0 100644 --- a/src/editor/kmcomposerwin.cpp +++ b/src/editor/kmcomposerwin.cpp @@ -451,7 +451,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState applyMainWindowSettings(KMKernel::self()->config()->group("Composer")); - connect(mEdtSubject, &PimCommon::LineEditWithAutoCorrection::textChanged, this, &KMComposerWin::slotUpdateWindowTitle); + mUpdateWindowTitleConnection = connect(mEdtSubject, &PimCommon::LineEditWithAutoCorrection::textChanged, this, &KMComposerWin::slotUpdateWindowTitle); mIdentityConnection = connect(identity, &KIdentityManagement::IdentityCombo::identityChanged, [this](uint val) { slotIdentityChanged(val); }); @@ -502,6 +502,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState KMComposerWin::~KMComposerWin() { + disconnect(mUpdateWindowTitleConnection); // When we have a collection set, store the message back to that collection. // Note that when we save the message or sent it, mFolder is set back to 0. // So this for example kicks in when opening a draft and then closing the window. diff --git a/src/editor/kmcomposerwin.h b/src/editor/kmcomposerwin.h index 4cff467e3..ba8a00a24 100644 --- a/src/editor/kmcomposerwin.h +++ b/src/editor/kmcomposerwin.h @@ -634,6 +634,7 @@ private: QString mdbusObjectPath; static int s_composerNumber; QMetaObject::Connection mIdentityConnection; + QMetaObject::Connection mUpdateWindowTitleConnection; MessageComposer::ComposerViewBase *mComposerBase = nullptr;