From 5de36bd1381b1d755c8f2dd4b95b9758d3225b14 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Tue, 9 Feb 2021 09:54:34 +0100 Subject: [PATCH] Clean up listener If the style is unloaded for example by an application dynamically switching styles, the listener was still around leading us to call into destroyed objects when the color scheme was changed. BUG:432660 --- kstyle/breezetoolsareamanager.cpp | 2 +- kstyle/breezetoolsareamanager.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kstyle/breezetoolsareamanager.cpp b/kstyle/breezetoolsareamanager.cpp index 39152e88..4f50b93b 100644 --- a/kstyle/breezetoolsareamanager.cpp +++ b/kstyle/breezetoolsareamanager.cpp @@ -41,7 +41,7 @@ namespace Breeze { void ToolsAreaManager::registerApplication(QApplication *application) { - _listener = new AppListener; + _listener = new AppListener(this); _listener->manager = this; if (application->property(colorProperty).isValid()) { auto path = application->property(colorProperty).toString(); diff --git a/kstyle/breezetoolsareamanager.h b/kstyle/breezetoolsareamanager.h index 04c26a01..5402576d 100644 --- a/kstyle/breezetoolsareamanager.h +++ b/kstyle/breezetoolsareamanager.h @@ -18,6 +18,7 @@ namespace Breeze { class AppListener : public QObject { Q_OBJECT + using QObject::QObject; bool eventFilter(QObject *watched, QEvent *event) override;