Regression?

Sebastian Sauer mail at dipe.org
Thu Feb 7 00:47:39 CET 2008


On Thursday 07 February 2008, Chani wrote:
> On February 7, 2008 06:56:20 Sebastian Sauer wrote:
> > On Wednesday 06 February 2008, you wrote:
> > > > which does in the Layout::Layout(LayoutItem *parent) ctor call
> > > > parent->setLayout(this) results somehow in an infinite loop calling
> > > > LayoutItem::setLayout(Layout* layout)
> > >
> > > does this patch fix it?
> >
> > unfortunately not :-/ Anyway, I'll try to investigate it tomorrow a bit
> > more in detail.
>
> the layout's destructor calls LayoutItem::setLayout(0) on the parent which
> then tries to delete the layout that's in the middle of being deleted...

strike!

with;

Index: libs/plasma/layouts/layout.cpp
===================================================================
--- libs/plasma/layouts/layout.cpp      (revision 771726)
+++ libs/plasma/layouts/layout.cpp      (working copy)
@@ -79,9 +79,11 @@

 Layout::~Layout()
 {
+/*
     if (parent()) {
         parent()->setLayout(0);
     }
+*/
     delete d;
 }

it doesn't end in a loop any longer, through now it crashes for me (backtrace 
attached) at the;

Containment::setFormFactor(FormFactor formFactor)
{
...
        delete lay;
...
}

and with;

Index: libs/plasma/containment.cpp
===================================================================
--- libs/plasma/containment.cpp (revision 771726)
+++ libs/plasma/containment.cpp (working copy)
@@ -331,8 +331,8 @@
     d->formFactor = formFactor;
     Layout *lay = layout();
     setLayout(0);
-    delete lay;
-    lay = 0;
+    //delete lay;
+    //lay = 0;

     switch (d->formFactor) {
         case Planar:

it works now again just without any crash :) Since the 4.0-branch seems to 
contain the same code, I wouldn't wonder if I just had "luck" here to run 
into it and it's one of those "it may crash" cases and probably even 
http://bugs.kde.org/show_bug.cgi?id=155808 is related.

So, thanks for the hint :)


More information about the Panel-devel mailing list