From 2c998e8f4dba4af17b55397094e6e61614307567 Mon Sep 17 00:00:00 2001 From: Wenhai Lin Date: Thu, 7 Apr 2016 23:05:29 +0800 Subject: [PATCH] Fixed crash --- native/cocos/base/CCEventDispatcher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/native/cocos/base/CCEventDispatcher.cpp b/native/cocos/base/CCEventDispatcher.cpp index 7254d27963..1988f98376 100644 --- a/native/cocos/base/CCEventDispatcher.cpp +++ b/native/cocos/base/CCEventDispatcher.cpp @@ -1297,7 +1297,9 @@ void EventDispatcher::removeEventListenersForTypeKey(const EventListener::TypeKe // Remove the dirty flag according the 'listenerID'. // No need to check whether the dispatcher is dispatching event. - _priorityDirtyFlagMap.erase(listenerID); + if (_priorityDirtyFlagMap.find(listenerID) != _priorityDirtyFlagMap.end()) { + _priorityDirtyFlagMap.erase(listenerID); + } if (_inDispatch == 0) {