diff --git a/cocos2d-win32.vc2010.sln b/cocos2d-win32.vc2010.sln index 6f159b22bd..33f9c7e372 100644 --- a/cocos2d-win32.vc2010.sln +++ b/cocos2d-win32.vc2010.sln @@ -40,6 +40,9 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WatermelonWithMe", "samples\WatermelonWithMe\proj.win32\WatermelonWithMe.vcxproj", "{BE092D9E-95AE-4F86-84CE-F4519E4F3F15}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CocosDragonJS", "samples\CocosDragonJS\proj.win32\CocosDragonJS.vcxproj", "{68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7}" + ProjectSection(ProjectDependencies) = postProject + {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} + EndProjectSection EndProject Global GlobalSection(DPCodeReviewSolutionGUID) = preSolution diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp index edb59be0bc..99cf59371e 100644 --- a/extensions/CCBReader/CCBReader.cpp +++ b/extensions/CCBReader/CCBReader.cpp @@ -226,6 +226,7 @@ CCNode* CCBReader::readNodeGraphFromFile(const char *pCCBFileName, CCObject *pOw unsigned char * pBytes = CCFileUtils::sharedFileUtils()->getFileData(pPath, "rb", &size); CCData *data = new CCData(pBytes, size); + CC_SAFE_DELETE_ARRAY(pBytes); CCNode *ret = this->readNodeGraphFromData(data, pOwner, parentSize); diff --git a/extensions/CCBReader/CCNodeLoader.cpp b/extensions/CCBReader/CCNodeLoader.cpp index 1eb8f73e6b..e86c900d9a 100644 --- a/extensions/CCBReader/CCNodeLoader.cpp +++ b/extensions/CCBReader/CCNodeLoader.cpp @@ -826,12 +826,14 @@ CCNode * CCNodeLoader::parsePropTypeCCBFile(CCNode * pNode, CCNode * pParent, CC ccbReader->getAnimationManager()->setRootContainerSize(pParent->getContentSize()); CCData *data = new CCData(pBytes, size); + CC_SAFE_DELETE_ARRAY(pBytes); + data->retain(); ccbReader->mData = data; ccbReader->mBytes = data->getBytes(); ccbReader->mCurrentByte = 0; ccbReader->mCurrentBit = 0; - pCCBReader->mOwner->retain(); + CC_SAFE_RETAIN(pCCBReader->mOwner); ccbReader->mOwner = pCCBReader->mOwner; ccbReader->mOwnerOutletNames = pCCBReader->mOwnerOutletNames; diff --git a/samples/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/samples/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp index 422033bae3..88060768b0 100644 --- a/samples/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp +++ b/samples/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp @@ -121,6 +121,8 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(CCObject * pSender, cocos2d // lblTestTitle is in the TestHeader.ccbi, which is referenced // from each of the test scenes. CCNode *animationsTest = ccbReader->readNodeGraphFromFile("ccb/ccb/TestAnimations.ccbi", this); + // Load node graph (TestAnimations is a sub class of CCLayer) and retrieve the ccb action manager + ((AnimationsTestLayer*)animationsTest)->setAnimationManager(ccbReader->getAnimationManager()); this->mTestTitleLabelTTF->setString("TestAnimations.ccbi");