From: Mikko Rasa Date: Fri, 27 Sep 2019 19:36:09 +0000 (+0300) Subject: Check that objects still exist when dispatching events to them X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0f32d120e05ebc207dcd2ea733714f29795cb26b;p=libs%2Fcore.git Check that objects still exist when dispatching events to them --- 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); }