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
This commit is contained in:
Martin Gräßlin 2010-06-19 15:23:48 +00:00
parent 2647a81954
commit 36744df4c1
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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();