From 0f32d120e05ebc207dcd2ea733714f29795cb26b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 27 Sep 2019 22:36:09 +0300 Subject: [PATCH] Check that objects still exist when dispatching events to them --- source/io/eventdispatcher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/io/eventdispatcher.cpp b/source/io/eventdispatcher.cpp index f98474c..49b28ac 100644 --- a/source/io/eventdispatcher.cpp +++ b/source/io/eventdispatcher.cpp @@ -65,7 +65,8 @@ void EventDispatcher::dispatch() { const vector &result = poller.get_result(); for(vector::const_iterator i=result.begin(); i!=result.end(); ++i) - i->object->event(i->events); + if(objects.count(Slot(*this, *i->object))) + i->object->event(i->events); } -- 2.45.2