添加删除子节点只能在主线程中进行吗?我要接受网络消息,根据网络消息来决定是否要removeChild,但程序在removeAllChildren时经常会出错 :Unknown commands in renderQueue
然后程序中断到
void GLProgramState::applyGLProgram(const Mat4& modelView)
{
CCASSERT(_glprogram, “invalid glprogram”);
…
…
程序的调用堆栈如下:
libcocos2d.dll!cocos2d::GLProgramState::applyGLProgram(const cocos2d::Mat4 & modelView) 行 340 C++
libcocos2d.dll!cocos2d::GLProgramState::apply(const cocos2d::Mat4 & modelView) 行 333 C++
libcocos2d.dll!cocos2d::QuadCommand::useMaterial() 行 98 C++
libcocos2d.dll!cocos2d::Renderer::drawBatchedQuads() 行 790 C++
libcocos2d.dll!cocos2d::Renderer::flush2D() 行 828 C++
libcocos2d.dll!cocos2d::Renderer::flush() 行 822 C++
libcocos2d.dll!cocos2d::Renderer::render() 行 530 C++
libcocos2d.dll!cocos2d::Scene::render(cocos2d::Renderer * renderer) 行 162 C++
libcocos2d.dll!cocos2d::Director::drawScene() 行 291 C++
libcocos2d.dll!cocos2d::DisplayLinkDirector::mainLoop() 行 1298 C++
libcocos2d.dll!cocos2d::Application::run() 行 94 C++
MailiLand.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) 行 17 C++
想问大神么,怎么解决添加删除节点和渲染线程的类似的并发问题?