prevent crashing on exit; layout must not be deleted before the applets which are managed by it.
this is a brittleness in the layout system that really needs to be addressed (and i added a comment and some debug output about this in LayoutItem) svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712164
This commit is contained in:
parent
d20c9a010f
commit
0fc83b6e76
@ -60,8 +60,8 @@ public:
|
||||
|
||||
~Private()
|
||||
{
|
||||
delete layout;
|
||||
qDeleteAll(applets);
|
||||
delete layout;
|
||||
}
|
||||
|
||||
bool immutable;
|
||||
|
@ -63,22 +63,22 @@ QGraphicsItem* LayoutItem::graphicsItem()
|
||||
|
||||
bool LayoutItem::hasHeightForWidth() const
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
qreal LayoutItem::heightForWidth(qreal w) const
|
||||
{
|
||||
return 0.0;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
bool LayoutItem::hasWidthForHeight() const
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
qreal LayoutItem::widthForHeight(qreal h) const
|
||||
{
|
||||
return 0.0;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void LayoutItem::setLayout(Layout* layout)
|
||||
@ -90,8 +90,15 @@ void LayoutItem::setLayout(Layout* layout)
|
||||
|
||||
d->layout = layout;
|
||||
|
||||
if ( layout )
|
||||
if (layout) {
|
||||
layout->setParent(this);
|
||||
} else {
|
||||
// FIXME: we had a layout, but now it has been removed
|
||||
// and we are without layout; we should tell our
|
||||
// children about this, but LayoutItem doesn't know
|
||||
// about children =/
|
||||
kDebug() << "layout removed from under us. expect crashes";
|
||||
}
|
||||
}
|
||||
|
||||
Layout* LayoutItem::layout() const
|
||||
|
Loading…
Reference in New Issue
Block a user