From a8b6e33d9cd00e3feea5411bcc45e5d94919ec39 Mon Sep 17 00:00:00 2001 From: Jason Xu Date: Tue, 21 Nov 2017 10:55:55 +0800 Subject: [PATCH] Unregister spine event lua event handler should set listener to null. (#12845) --- .../lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp b/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp index 7a0e9c8558..13a83b0312 100644 --- a/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp @@ -320,21 +320,25 @@ int tolua_Cocos2d_CCSkeletonAnimation_unregisterSpineEventHandler00(lua_State* t switch (eventType) { case spEventType::SP_ANIMATION_START: handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_START; + self->setStartListener(nullptr); break; case spEventType::SP_ANIMATION_INTERRUPT: handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_INTERRUPT; break; case spEventType::SP_ANIMATION_END: handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_END; + self->setEndListener(nullptr); break; case spEventType::SP_ANIMATION_DISPOSE: handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_DISPOSE; break; case spEventType::SP_ANIMATION_COMPLETE: handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_COMPLETE; + self->setCompleteListener(nullptr); break; case spEventType::SP_ANIMATION_EVENT: handlerType = ScriptHandlerMgr::HandlerType::EVENT_SPINE_ANIMATION_EVENT; + self->setEventListener(nullptr); break; default: