Forward port fix for #158131. Fix crash when removing actions owned by an invalid controller.

BUG: 158131


svn path=/trunk/KDE/kdebase/apps/konsole/; revision=777943
This commit is contained in:
Robert Knight
2008-02-21 23:23:22 +00:00
parent 49c2b3fccb
commit fba52f75b6
2 changed files with 20 additions and 1 deletions

View File

@@ -133,7 +133,14 @@ void MainWindow::disconnectController(SessionController* controller)
{
disconnect( controller , SIGNAL(titleChanged(ViewProperties*))
, this , SLOT(activeViewTitleChanged(ViewProperties*)) );
guiFactory()->removeClient(controller);
// KXmlGuiFactory::removeClient() will try to access actions associated
// with the controller internally, which may not be valid after the controller
// itself is no longer valid (after the associated session and or view have
// been destroyed)
if (controller->isValid())
guiFactory()->removeClient(controller);
controller->setSearchBar(0);
}