[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: [patch] fix crashes when source applet of extender is removed
From: Sebastian =?iso-8859-1?q?K=FCgler?= <sebas () kde ! org>
Date: 2009-01-30 10:06:35
Message-ID: 200901301106.36318.sebas () kde ! org
[Download RAW message or body]
I've run into two subsequent crashes in extenderitem.cpp, those are
reproducible for me as follows:
- d&d an extenderitem from an applet onto the desktop (it creates its own
applet then)
- Remove the source applet
- Remove the newly created extenderapplet
- Boom (in the check for d->sourceApplet
- Boom (setExtender(d->sourceApplet->d->extender);)
The attached patch fixes both. One issue I've run into is that the source
applet still seems to own the content of the extenderitem. When removing the
source applet, it goes away. So I'm wondering if it makes sense at all to keep
the extenderitem around when the source applet goes away and takes the content
of the extenderitem with it into Nirvana. It would be cool if that worked
somehow, though.
In any case, plasma-desktop shouldn't crash, so OK to commit? Should it be
backported?
--
sebas
http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
["extenderitem-source-applet-removed.diff" (text/x-patch)]
Index: extenderitem.cpp
===================================================================
--- extenderitem.cpp (revision 918514)
+++ extenderitem.cpp (working copy)
@@ -450,10 +450,12 @@
void ExtenderItem::returnToSource()
{
- if (!d->sourceApplet) {
+ if (!d || !d->sourceApplet) {
return;
}
- setExtender(d->sourceApplet->d->extender);
+ if (d->sourceApplet->d) {
+ setExtender(d->sourceApplet->d->extender);
+ }
}
void ExtenderItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic