Commit 392ce42f authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Delete client builder before d-pointer of KXMLGUIClient is killed

BUG: 432421
(cherry picked from commit 0bc553fd)
parent c584fed8
......@@ -1766,10 +1766,9 @@ void SessionController::showDisplayContextMenu(const QPoint& position)
// application did not merge our GUI.
if (factory() == nullptr) {
if (clientBuilder() == nullptr) {
setClientBuilder(new KXMLGUIBuilder(_sessionDisplayConnection->view()));
// Client builder does not get deleted automatically
connect(this, &QObject::destroyed, this, [this]{ delete clientBuilder(); });
// Client builder does not get deleted automatically, we handle this
_clientBuilder.reset(new KXMLGUIBuilder(_sessionDisplayConnection->view()));
setClientBuilder(_clientBuilder.get());
}
auto factory = new KXMLGUIFactory(clientBuilder(), _sessionDisplayConnection->view());
......
......@@ -30,6 +30,8 @@
// KDE
#include <KXMLGUIClient>
#include <memory>
// Konsole
#include "SessionDisplayConnection.h"
#include "ViewProperties.h"
......@@ -368,6 +370,7 @@ private:
bool _monitorProcessFinish;
EscapeSequenceUrlFilter *_escapedUrlFilter;
std::unique_ptr<KXMLGUIBuilder> _clientBuilder;
};
}
......
Markdown is supported
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