From 82cc9c0cf2cdb8de17233a2ea943a5247d5da305 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 3 Apr 2015 00:48:56 +0200 Subject: menu/application: Remove singleton. The singleton pattern should not be used in most cases, because it behaves like global variables. --- src/menu/application.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/menu/application.hpp') diff --git a/src/menu/application.hpp b/src/menu/application.hpp index a47bd42a..6d1b2b44 100644 --- a/src/menu/application.hpp +++ b/src/menu/application.hpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -37,13 +38,12 @@ namespace usdx { - class Application : public Container + class Application : public Container, public boost::noncopyable { private: static log4cpp::Category& log; - static Application* instance; - Config* config; + static Config* config; SDL_Surface* display; FPSmanager* fps_manager; @@ -56,20 +56,17 @@ namespace usdx * This is the main loop. */ void main_loop(SDL_Surface* display); - boost::thread::id gl_thread; + static boost::thread::id gl_thread; boost::thread event_thread; void init_fps_manager(void); protected: - Application(Container* parent); public: + Application(void); virtual ~Application(); - static Application* get_instance(void); - static void free(void); - static Config* get_config(void); static bool is_gl_thread(void); -- cgit v1.2.3