]> git.tdb.fi Git - libs/game.git/blobdiff - source/game/eventbus.h
Plug a memory leak in EventBus
[libs/game.git] / source / game / eventbus.h
index a4de18f2bb24c699fb73aea61794b73578cdba77..b9e6c7890c77f5a56cb83f83cfd20c95c08a57c3 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <functional>
 #include <vector>
+#include <msp/core/noncopyable.h>
 
 namespace Msp::Game {
 
@@ -30,7 +31,7 @@ struct EventDispatcher
 };
 
 
-class EventBus
+class EventBus: public NonCopyable
 {
 private:
        using DeleteFunc = void(void *);
@@ -45,6 +46,10 @@ private:
 
        std::vector<Dispatcher> dispatchers;
 
+public:
+       ~EventBus();
+
+private:
        static unsigned get_next_id();
 
 public: