• Raphael Kubo da Costa's avatar
    Stop crashing on exit when being used solely as a KPart. · 9c30f30b
    Raphael Kubo da Costa authored
    This change fixes a crash introduced by commit 3b981ca9 ("Remove Part
    from KXMLGUIFactory on exit").
    
    Part::~Part() is the wrong place to call KXMLGUIFactory::removeClient(),
    as it assumes addClient() had been called in the first place.
    
    This is only true if Ark is called as a standalone program, since that
    is done in MainWindow::loadPart()'s call to KXMLGuiWindow::createGUI().
    
    Conversely, if the Ark KPart is being used as an embedded viewer in,
    say, Konqueror or to preview an archive inside an archive (ie. Ark
    inside Ark) that does not hold true and we try to access a
    KXMLGUIFactory that does not exist.
    
    Instead, call KXMLGuiWindow::removeClient() in MainWindow's destructor,
    since in this case we are certain that addClient() was been called
    before.
    
    BUG:      341187
    FIXED-IN: 14.12
    9c30f30b
mainwindow.cpp 7.7 KB