Commit 0bc553fd authored by Christoph Cullmann's avatar Christoph Cullmann 🐮 Committed by David Faure
Browse files

delete client builder before d-pointer of KXMLGUIClient is killed

BUG: 432421
parent 8936b4db
......@@ -1764,10 +1764,9 @@ void SessionController::showDisplayContextMenu(const QPoint& position)
// application did not merge our GUI.
if (factory() == nullptr) {
if (clientBuilder() == nullptr) {
setClientBuilder(new KXMLGUIBuilder(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(view()));
setClientBuilder(_clientBuilder.get());
}
auto factory = new KXMLGUIFactory(clientBuilder(), view());
......
......@@ -17,6 +17,8 @@
// KDE
#include <KXMLGUIClient>
#include <memory>
// Konsole
#include "SessionDisplayConnection.h"
#include "ViewProperties.h"
......@@ -357,6 +359,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