Skip to content
Commit cd8ad276 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa
Browse files

Stop crashing on exit when being used solely as a KPart.

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.

CCBUG:      341187

(cherry picked from commit 9c30f30b)
This was committed for completeness, as there will be no additional
releases from the KDE/4.14 branch.

Conflicts:
	part/part.cpp
parent 3b981ca9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment