Merge pull request #6177 from DarraghCoy/small_dangling_ptr_fix

Small dangling ptr fix to EventDispatcher::removeEventListenersForTarget
This commit is contained in:
James Chen 2014-04-09 13:22:24 +08:00
commit d93a7e6445
1 changed files with 1 additions and 0 deletions

View File

@ -351,6 +351,7 @@ void EventDispatcher::removeEventListenersForTarget(Node* target, bool recursive
if (listener->getSceneGraphPriority() == target)
{
listener->setSceneGraphPriority(nullptr); // Ensure no dangling ptr to the target node.
listener->setRegistered(false);
listener->release();
iter = _toAddedListeners.erase(iter);