From b6213cdd59cc6826b33a6f4d7ce77ae7787c5146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= Date: Wed, 26 Feb 2020 10:00:41 +0100 Subject: [PATCH] Dialog: disconnect from QWindow signals in destructor Summary: When Dialog is being destroyed, its QWindow super-class may still emit some signals from its destructor. Dialog is connected so some of them, so this leads to Qt invoking slots on Dialog, whose destructor has already been called, leading to crashes. This patch disconnects all internal connections in Dialog's destructor. See https://phabricator.kde.org/D23339 for details. Test Plan: Plasma no longer crashes when a notification appears Reviewers: #plasma, nicolasfella, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27671 --- src/plasmaquick/dialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index 41a3f0302..cc4863a2d 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -835,6 +835,9 @@ Dialog::~Dialog() if (!QCoreApplication::instance()->closingDown()) { DialogShadows::self()->removeWindow(this); } + + // Prevent signals from super-class destructor invoking our now-destroyed slots + disconnect(this, nullptr, this, nullptr); } QQuickItem *Dialog::mainItem() const