To properly destroy a singleton. More...
#include <SingletonDestroyer.h>
Public Member Functions | |
void | SetSingleton (Data_T *t) |
SingletonDestroyer (Data_T *t=0x0) | |
virtual | ~SingletonDestroyer () |
To properly destroy a singleton.
The way it works is the following : Add to your class a
static SingletonDestroyer<MyType> gTheSingletonDestroyer;
(not a pointer but a real object !) Once the pointer of the singleton is created, pass it to the destroyer using SetSingleton
Once the program is finished, the destructo of the destroyer is called. This one delete the singleton
Definition at line 41 of file SingletonDestroyer.h.