don't try to update the labels when the extender is in its destructor

crash--

svn path=/trunk/KDE/kdelibs/; revision=1131699
This commit is contained in:
Marco Martin 2010-05-28 18:12:13 +00:00
parent f99d57fdc1
commit 4d23421690

View File

@ -109,6 +109,7 @@ Extender::Extender(Applet *applet)
Extender::~Extender()
{
d->destroying = true;
foreach (ExtenderItem *item, d->attachedExtenderItems) {
disconnect(item, 0, this, 0);
delete item;
@ -465,6 +466,10 @@ void Extender::itemAddedEvent(ExtenderItem *item, const QPointF &pos)
void Extender::itemRemovedEvent(ExtenderItem *item)
{
if (d->destroying) {
return;
}
d->layout->removeItem(item);
if (d->spacerWidget) {
@ -563,7 +568,8 @@ ExtenderPrivate::ExtenderPrivate(Applet *applet, Extender *extender) :
spacerWidget(0),
emptyExtenderMessage(QString()),
emptyExtenderLabel(0),
appearance(Extender::NoBorders)
appearance(Extender::NoBorders),
destroying(false)
{
background->setImagePath("widgets/extender-background");
}