Bug 47877 - PartManager does not inform its parts that it is going to be destroyed
Summary: PartManager does not inform its parts that it is going to be destroyed
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Simon Hausmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-15 10:11 UTC by Heinz Hornung
Modified: 2002-09-16 14:43 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heinz Hornung 2002-09-15 10:11:57 UTC
Version:           gideon HEAD from approximately 13/09/2002 (using KDE KDE 3.0.7)
Installed from:    Compiled From Sources
OS:          Linux

I came accross a bug which causes gideon to crash on leaving. 
The bug is located in the PartManager of kdelib-3.0.7. The PartManager does not inform its parts if it is about to be destroyed. Therefore, a part tries to access its PartManager, even if it is gone. The following patch takes care of this bug:

*** ../../temp/kdelibs-3.0.7/kparts/partmanager.cpp	Mon Aug  5 17:39:45 2002
--- kparts/partmanager.cpp	Sun Sep 15 09:47:08 2002
***************
*** 103,108 ****
--- 103,116 ----

    // core dumps ... setActivePart( 0L );
    qApp->removeEventFilter( this );
+
+   // Inform all parts that their manager is gone.
+   QPtrListIterator<Part> itpart ( d->m_parts );
+   for ( ; itpart.current() ; ++itpart )
+   {
+       itpart.current()->setManager(0);
+   }
+
    delete d;
  }
Comment 1 Heinz Hornung 2002-09-15 10:18:51 UTC
I've already sent this information to the kdevelop-team and wanted to inform 
the KDE-Team as well. Didn't mean to send the same report twice to the 
kdevelop-team...  
Comment 2 Simon Hausmann 2002-09-15 11:25:35 UTC
Quite an uncommon case that the partmanager is destroyed before the parts, which
is probably why noone noticed this bug before :) . In any case thanks a lot for
the report/patch, it's fixed now in HEAD.