Index: sources/main.h =================================================================== diff -u -r781e62c996e81897517fbdb1bc79fe3bbcf165c1 -r56d00a82669a7a2c00ab90109a89dbec8db27527 --- sources/main.h (.../main.h) (revision 781e62c996e81897517fbdb1bc79fe3bbcf165c1) +++ sources/main.h (.../main.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) @@ -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;