From 0f729126f070f96d1e9a8b0bc1681904033084d6 Mon Sep 17 00:00:00 2001 From: Darragh Coy Date: Thu, 27 Mar 2014 20:11:37 -0700 Subject: [PATCH] Find another instance where we should null out the node pointer for the current listener after it has been disassociated with the node. --- cocos/2d/CCEventDispatcher.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/2d/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp index c9cf4301e6..38ef104175 100644 --- a/cocos/2d/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -1218,6 +1218,7 @@ void EventDispatcher::removeEventListenersForListenerID(const EventListener::Lis 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)