mirror of https://github.com/axmolengine/axmol.git
When an event listener is removed from the scene and has a node associated with it, NULL out the node pointer so as not to leave any dangling pointers.
This commit is contained in:
parent
a778d07ecc
commit
c6cd927ea5
|
@ -561,6 +561,7 @@ void EventDispatcher::removeEventListener(EventListener* listener)
|
|||
if (l->getSceneGraphPriority() != nullptr)
|
||||
{
|
||||
dissociateNodeAndEventListener(l->getSceneGraphPriority(), l);
|
||||
l->setSceneGraphPriority(nullptr); // NULL out the node pointer so we don't have any dangling pointers to destroyed nodes.
|
||||
}
|
||||
|
||||
if (_inDispatch == 0)
|
||||
|
|
Loading…
Reference in New Issue