From 0f52ab9c4b0f0637d02c3048df498bf778502295 Mon Sep 17 00:00:00 2001 From: APTX Date: Mon, 5 Nov 2012 22:16:29 +0100 Subject: [PATCH] Add option to disable automatic destruction of MyList. --- localmylist/mylist.cpp | 4 +++- localmylist/mylist.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/localmylist/mylist.cpp b/localmylist/mylist.cpp index da2b9ff..0fc4cc3 100644 --- a/localmylist/mylist.cpp +++ b/localmylist/mylist.cpp @@ -290,7 +290,8 @@ void MyList::init() static bool init = false; if (init) return; - qAddPostRoutine(MyList::destroy); + if (!MANUAL_CLEANUP) + qAddPostRoutine(MyList::destroy); if (!REGISTER_QT_TYPES) return; // qRegisterMetaType("AbstractTaskPtr"); @@ -298,6 +299,7 @@ void MyList::init() } bool MyList::REGISTER_QT_TYPES = true; +bool MyList::MANUAL_CLEANUP = false; MyList *MyList::m_instance = 0; MyList *instance() diff --git a/localmylist/mylist.h b/localmylist/mylist.h index 99b3e56..41c4701 100644 --- a/localmylist/mylist.h +++ b/localmylist/mylist.h @@ -91,6 +91,7 @@ public: static void destroy(); static bool REGISTER_QT_TYPES; + static bool MANUAL_CLEANUP; static const char *organizationName; static const char *libraryName; -- 2.52.0