Commit eba018e1 authored by David Faure's avatar David Faure
Browse files

Hard to not make it a singleton, mainwindows are created in many places.

But fix konqviewtest by adding an explicit KonqClosedWindowsManager::destroy()
parent e23337ba
......@@ -45,7 +45,7 @@ public:
int m_maxNumClosedItems;
};
Q_GLOBAL_STATIC(KonqClosedWindowsManagerPrivate, myKonqClosedWindowsManagerPrivate)
static KonqClosedWindowsManagerPrivate *myKonqClosedWindowsManagerPrivate = nullptr;
KonqClosedWindowsManager::KonqClosedWindowsManager()
{
......@@ -88,9 +88,18 @@ KConfig *KonqClosedWindowsManager::memoryStore()
KonqClosedWindowsManager *KonqClosedWindowsManager::self()
{
if (!myKonqClosedWindowsManagerPrivate) {
myKonqClosedWindowsManagerPrivate = new KonqClosedWindowsManagerPrivate;
}
return &myKonqClosedWindowsManagerPrivate->instance;
}
void KonqClosedWindowsManager::destroy()
{
delete myKonqClosedWindowsManagerPrivate;
myKonqClosedWindowsManagerPrivate = nullptr;
}
void KonqClosedWindowsManager::addClosedWindowItem(KonqUndoManager
*real_sender, KonqClosedWindowItem *closedWindowItem, bool propagate)
{
......
......@@ -50,6 +50,7 @@ public:
~KonqClosedWindowsManager() override;
static KonqClosedWindowsManager *self();
static void destroy();
const QList<KonqClosedWindowItem *> &closedWindowItemList();
......
......@@ -27,6 +27,7 @@
#include "konqview.h"
#include "konqsettingsxt.h"
#include "konqurl.h"
#include "konqclosedwindowsmanager.h"
#include <KAboutData>
#include <KCrash>
......@@ -302,5 +303,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
KonqSessionManager::self()->disableAutosave();
KonqSessionManager::self()->deleteOwnedSessions();
KonqClosedWindowsManager::destroy();
return ret;
}
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