Gideon crashes when opening a file in MDI mode

John Firebaugh jfirebaugh at kde.org
Tue May 21 00:39:02 UTC 2002


On Monday 20 May 2002 1:26, falk.brettschneider at gmx.de wrote:
> Widgets wrapped with QextMdiChildView must be unwrapped on file closing
> - otherwise it will crash on double deletion because of Qt's mechanism
> for the automatic deletion of child widgets. That's why use
> QextMdiMainFrm::removeWindowFromMdi() before deleting the embedded
> editor widget (to reparent the widget to parent 0L). See class
> DocViewMan in KDevelop-2.

Yes, this was happening; the reason for the crash was some complex interaction 
between gideon, KParts, KXMLGUI, and the destroyed() signal of QWidget. For 
the curious, here's the comment in PartController::closePart():

// If we didn't call removePart(), KParts::PartManager::slotObjectDestroyed 
would
  // get called from the destroyed signal of the part being deleted below.
  // The call chain from that looks like this:
  // QObject::destroyed()
  //   KParts::PartManager::slotWidgetDestroyed() -> setActivePart() -> 
activePartChanged()
  //     TopLevelXXX::createGUI()
  //       KXMLGUIFactory::removeClient()
  // But then KXMLGUIFactory tries to remove the already-deleted part.
  // Normally this would work, because the factory uses a QGuardedPtr to the 
part.
  // But the QGuardedPtr is connected to the _same_ destroyed() slot that got 
us to
  // that point (slots are called in an undefined order)!
  removePart( part );





More information about the KDevelop-devel mailing list