mirror of https://github.com/axmolengine/axmol.git
Merge commit 'refs/pull/4069/head' of git://github.com/cocos2d/cocos2d-x into eventdispatcher-fix
This commit is contained in:
commit
a4b28353a7
|
@ -442,9 +442,16 @@ void EventDispatcher::removeEventListener(EventListener* listener)
|
|||
break;
|
||||
}
|
||||
|
||||
if (isFound)
|
||||
{
|
||||
if (isFound) {
|
||||
CC_SAFE_RELEASE(listener);
|
||||
} else {
|
||||
for(auto iter=_toAddedListeners.begin(); iter != _toAddedListeners.end(); ++iter) {
|
||||
if ((*iter)->listener == listener)
|
||||
{
|
||||
_toAddedListeners.erase(iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue