From: APTX Date: Mon, 5 Nov 2012 21:16:29 +0000 (+0100) Subject: Add option to disable automatic destruction of MyList. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=0f52ab9c4b0f0637d02c3048df498bf778502295;p=localmylist.git Add option to disable automatic destruction of MyList. --- 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;