From 4b0d4c4bdaed65f52d7f2110c53ce984ef459b5a Mon Sep 17 00:00:00 2001 From: Konrad Materka Date: Thu, 30 Apr 2020 22:06:49 +0200 Subject: [PATCH] [PlasmaCore.IconItem] Regression: fix crash on source change Summary: When SvgSource is changed, old one is deleted. Connections are not automatically disconnected. This change disconnects connections and fixes regression introduced in D28470. BUG: 420801 FIXED-IN: 5.70 Test Plan: STEPS TO REPRODUCE 1. click on mute button for a device 2. click on the desktop to collapse the applet OBSERVED RESULT crash in step 1 and in the rare case it doesn't crash it crash in step 2 EXPECTED RESULT don't crash Reviewers: #plasma, #frameworks, ngraham, davidedmundson Reviewed By: ngraham Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D29314 --- src/declarativeimports/core/iconitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index 3b5049aef..c59fd1827 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -53,7 +53,6 @@ protected: return m_iconItem->window(); } -private: IconItem *m_iconItem; }; @@ -196,6 +195,10 @@ public: } } + ~SvgSource() { + QObject::disconnect(m_iconItem, nullptr, m_svgIcon, nullptr); + } + bool isValid() const override { return m_svgIcon;