Index: sources/main.h =================================================================== diff -u -r62efc6d8ead9b39b47859fdc9c0661f30b5941d0 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/main.h (.../main.h) (revision 62efc6d8ead9b39b47859fdc9c0661f30b5941d0) +++ sources/main.h (.../main.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -22,16 +22,21 @@ // Project -#define SINGLETON_DECL(vCLASS) \ +// TODO : A singleton parent class needs to be created +// to taking care of the Threading, init, quit, and so + +// TODO : +// - We still need to work on threading on other classes +// - We need to have a singleton parent class +// - Some code has been added to debug can interface (We still have swap frames) +#define SINGLETON(vCLASS) \ private: \ - static vCLASS *_instance; \ explicit vCLASS(QObject *parent = nullptr); \ + virtual ~vCLASS() { } \ + vCLASS(vCLASS const &) = delete; \ + vCLASS & operator = (vCLASS const &) = delete; \ public: \ - static vCLASS *I() { \ - if (!_instance) \ - _instance = new vCLASS(); \ - return _instance; \ + static vCLASS &I() { \ + static vCLASS _instance; \ + return _instance; \ } - -#define SINGLETON_INIT(vCLASS) \ - vCLASS *vCLASS::_instance = nullptr;