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:
Darragh Coy 2014-03-27 15:37:16 -07:00
parent a778d07ecc
commit c6cd927ea5
1 changed files with 1 additions and 0 deletions

View File

@ -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)