From c200fbb2a7c00f9506933ed67d55cae30475998d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 27 Aug 2013 22:39:17 +0300 Subject: [PATCH] Avoid leaking external references through default c'tors and d'tors --- source/io/eventdispatcher.cpp | 3 +++ source/io/eventdispatcher.h | 1 + source/io/eventobject.cpp | 3 +++ source/io/eventobject.h | 1 + 4 files changed, 8 insertions(+) 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: -- 2.45.2