From: Mikko Rasa Date: Tue, 27 Aug 2013 19:39:17 +0000 (+0300) Subject: Avoid leaking external references through default c'tors and d'tors X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c200fbb2a7c00f9506933ed67d55cae30475998d;p=libs%2Fcore.git Avoid leaking external references through default c'tors and d'tors --- diff --git a/source/io/eventdispatcher.cpp b/source/io/eventdispatcher.cpp index 3a3baa6..144ad49 100644 --- a/source/io/eventdispatcher.cpp +++ b/source/io/eventdispatcher.cpp @@ -9,6 +9,9 @@ namespace IO { EventDispatcher::EventDispatcher() { } +EventDispatcher::~EventDispatcher() +{ } + void EventDispatcher::add(EventObject &obj) { SlotMap::iterator i = objects.find(&obj); diff --git a/source/io/eventdispatcher.h b/source/io/eventdispatcher.h index 04d037e..25455ab 100644 --- a/source/io/eventdispatcher.h +++ b/source/io/eventdispatcher.h @@ -32,6 +32,7 @@ private: public: EventDispatcher(); + ~EventDispatcher(); void add(EventObject &); void remove(EventObject &); diff --git a/source/io/eventobject.cpp b/source/io/eventobject.cpp index 333d112..d61543c 100644 --- a/source/io/eventobject.cpp +++ b/source/io/eventobject.cpp @@ -7,6 +7,9 @@ EventObject::EventObject(): events(P_NONE) { } +EventObject::~EventObject() +{ } + void EventObject::set_events(PollEvent e) { events = e; diff --git a/source/io/eventobject.h b/source/io/eventobject.h index 16d6d82..88a71c7 100644 --- a/source/io/eventobject.h +++ b/source/io/eventobject.h @@ -29,6 +29,7 @@ private: protected: EventObject(); + virtual ~EventObject(); void set_events(PollEvent); public: