Find another instance where we should null out the node pointer for the current listener after it has been disassociated with the node.

This commit is contained in:
Darragh Coy 2014-03-27 20:11:37 -07:00
parent 8ca3cf8a93
commit 0f729126f0
1 changed files with 1 additions and 0 deletions

View File

@ -1218,6 +1218,7 @@ void EventDispatcher::removeEventListenersForListenerID(const EventListener::Lis
if (l->getSceneGraphPriority() != nullptr) if (l->getSceneGraphPriority() != nullptr)
{ {
dissociateNodeAndEventListener(l->getSceneGraphPriority(), l); 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) if (_inDispatch == 0)