From 36744df4c17c18a6b6c41523daa9fe184ceea224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 19 Jun 2010 15:23:48 +0000 Subject: [PATCH] Defer deletion of the AuroraeScene and View to the next event loop. It is possible that the scene get's deleted before processing mouse events is finished which causes crashes. BUG: 242165 FIXED-IN: 4.5.0 CCBUG: 241876 CCBUG: 242116 svn path=/trunk/KDE/kdebase/workspace/; revision=1139942 --- clients/aurorae/src/aurorae.cpp | 9 ++++++++- clients/aurorae/src/aurorae.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 623c2a3e5d..8e693bd105 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -134,7 +134,7 @@ AuroraeClient::AuroraeClient(KDecorationBridge *bridge, KDecorationFactory *fact m_scene = new AuroraeScene(AuroraeFactory::instance()->theme(), options()->customButtonPositions() ? options()->titleButtonsLeft() : AuroraeFactory::instance()->theme()->defaultButtonsLeft(), options()->customButtonPositions() ? options()->titleButtonsRight() : AuroraeFactory::instance()->theme()->defaultButtonsRight(), - providesContextHelp(), this); + providesContextHelp(), NULL); connect(m_scene, SIGNAL(closeWindow()), SLOT(closeWindow())); connect(m_scene, SIGNAL(maximize(Qt::MouseButtons)), SLOT(maximize(Qt::MouseButtons))); connect(m_scene, SIGNAL(showContextHelp()), SLOT(showContextHelp())); @@ -164,6 +164,13 @@ AuroraeClient::AuroraeClient(KDecorationBridge *bridge, KDecorationFactory *fact connect(this, SIGNAL(keepBelowChanged(bool)), SLOT(keepBelowChanged(bool))); } +AuroraeClient::~AuroraeClient() +{ + m_view->setParent(NULL); + m_view->deleteLater(); + m_scene->deleteLater(); +} + void AuroraeClient::init() { // HACK: we need to add the GraphicsView as a child widget to a normal widget diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index 12cd90f234..f920533473 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -62,6 +62,7 @@ class AuroraeClient : public KDecorationUnstable Q_OBJECT public: AuroraeClient(KDecorationBridge* bridge, KDecorationFactory* factory); + virtual ~AuroraeClient(); virtual void activeChange(); virtual void borders(int& left, int& right, int& top, int& bottom) const; virtual void captionChange();