mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6177 from DarraghCoy/small_dangling_ptr_fix
Small dangling ptr fix to EventDispatcher::removeEventListenersForTarget
This commit is contained in:
commit
d93a7e6445
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue