1. fixes scene parse crash.

This commit is contained in:
zhangcheng 2014-07-02 15:58:42 +08:00
parent 9204ac28df
commit 2b1ef55ea9
1 changed files with 3 additions and 0 deletions

View File

@ -123,6 +123,7 @@ cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName,
{
data->_rData = nullptr;
data->_cocoNode = subDict;
data->_cocoLoader = &tCocoLoader;
if (pCom->serialize(data))
{
ComRender *pTRender = dynamic_cast<ComRender*>(pCom);
@ -283,6 +284,7 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par
{
data->_rData = &subDict;
data->_cocoNode = nullptr;
data->_cocoLoader = nullptr;
if (com->serialize(data))
{
ComRender *tRender = dynamic_cast<ComRender*>(com);
@ -387,6 +389,7 @@ cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode *
{
data->_rData = nullptr;
data->_cocoNode = subDict;
data->_cocoLoader = cocoLoader;
if (pCom->serialize(data))
{
ComRender *pTRender = dynamic_cast<ComRender*>(pCom);