From 3439b7f68d84ba991398d303e017e1934791fe37 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 5 Dec 2014 15:48:46 +0800 Subject: [PATCH] refactor async load callback funtion --- cocos/3d/CCSprite3D.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 924b92bdc0..b949c06f77 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -98,10 +98,10 @@ void Sprite3D::createAsync(const std::string &modelPath, const std::string &text sprite->_asyncLoadParam.materialdatas = new (std::nothrow) MaterialDatas(); sprite->_asyncLoadParam.meshdatas = new (std::nothrow) MeshDatas(); sprite->_asyncLoadParam.nodeDatas = new (std::nothrow) NodeDatas(); - AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(Sprite3D::afterAsyncLoad, sprite), (void*)(&sprite->_asyncLoadParam), [](Sprite3D* sp) + AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(Sprite3D::afterAsyncLoad, sprite), (void*)(&sprite->_asyncLoadParam), [sprite]() { - sp->_asyncLoadParam.result = sp->loadFromFile(sp->_asyncLoadParam.path, sp->_asyncLoadParam.nodeDatas, sp->_asyncLoadParam.meshdatas, sp->_asyncLoadParam.materialdatas); - }, sprite); + sprite->_asyncLoadParam.result = sprite->loadFromFile(sprite->_asyncLoadParam.path, sprite->_asyncLoadParam.nodeDatas, sprite->_asyncLoadParam.meshdatas, sprite->_asyncLoadParam.materialdatas); + }); }