]> Some of my projects - localmylist.git/commitdiff
Add option to disable automatic destruction of MyList.
authorAPTX <marek321@gmail.com>
Mon, 5 Nov 2012 21:16:29 +0000 (22:16 +0100)
committerAPTX <marek321@gmail.com>
Mon, 5 Nov 2012 21:16:29 +0000 (22:16 +0100)
localmylist/mylist.cpp
localmylist/mylist.h

index da2b9ff5a8c0a27b54c30fa3bca5258dc87843ca..0fc4cc3a27f5240efe7bd61d5938f2d412f7f6df 100644 (file)
@@ -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>("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()
index 99b3e565904811b8c5b80e24129f69c54b920f1e..41c47015bf244e9d77ce802936a55b4bac2d0a03 100644 (file)
@@ -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;