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)