Delete singleton instance last, which seems slightly more robust.
This commit is contained in:
@@ -151,9 +151,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void deleteSingleton()
|
static void deleteSingleton()
|
||||||
{
|
{
|
||||||
delete getData().mSingletonInstance;
|
DERIVED_TYPE* instance = getData().mSingletonInstance;
|
||||||
getData().mSingletonInstance = NULL;
|
|
||||||
getData().mInitState = DELETED;
|
getData().mInitState = DELETED;
|
||||||
|
getData().mSingletonInstance = NULL;
|
||||||
|
delete instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SingletonInstanceData& getData()
|
static SingletonInstanceData& getData()
|
||||||
|
|||||||
Reference in New Issue
Block a user