自定义事件CustomEvent C++ lua

我在C++的socket 消息接收线程里触发自定义事件:
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchCustomEvent(“MsgRecv_Event”);


LUA里写了自定义事件的响应:
local function MsgRecvCallBack(event)
printf(“Test Custom Event”)
end

local listenerMsgRecv=cc.EventListenerCustom:create(“MsgRecv_Event”,MsgRecvCallBack)
local customEventDispatch=cc.Director:getInstance():getEventDispatcher()
customEventDispatch:addEventListenerWithFixedPriority(listenerMsgRecv, 1)


运行后能正常响应几次事件,然后就出现错误:
[LUA-print] Test Custom Event
[LUA-print] Test Custom Event
[LUA-print] Test Custom Event
[LUA-print] Test Custom Event
Assert failed: _inDispatch should be 1 here.
[LUA-print] Test Custom Event
Assertion failed!

Program: …roidDevelop\Code\test\simulator\win32\libcocos2d.dll
File: …\base\CCEventDispatcher.cpp
Line: 1227

Expression: _inDispatch == 1

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)

求救!!!!!!!