I update my code from 2.0.4 to 2.1. In 2.0.4 it works, the code is same, but in 2.1 there is a memory leak problem. Is it a bug?
It seems that when closing the m_uReference of CHomeScene is greater than 0.
code:
CCScene * CHomeScene::scene()
{
CCScene * scene = CCScene::create();
CCNodeLoaderLibrary * loaderlib = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
loaderlib->registerCCNodeLoader("CHomeScene", CHomeSceneLoader::loader());
cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(loaderlib);
CCNode * node = ccbReader->readNodeGraphFromFile("home.ccbi", scene);
if (node != NULL)
{
scene->addChild(node);
}
ccbReader->release();
return scene;
}
when I developed with cocos2d, I found that producting a instance with cocosbuilder will cause memory leak, so I do this:
prodectedNode->stopAllAction();
LI LONG wrote:
when I developed with cocos2d, I found that producting a instance with cocosbuilder will cause memory leak, so I do this:
prodectedNode->stopAllAction();
It’s the different thing. The same code but not the same result(memory leak). Anything changed in 2.1?
I will run tests to checkout it.
Did you use xcode to detect memory leak?
worm wang wrote:
I update my code from 2.0.4 to 2.1. In 2.0.4 it works, the code is same, but in 2.1 there is a memory leak problem. Is it a bug?
>
It seems that when closing the m_uReference of CHomeScene is greater than 0.
>
code:
[…]
I am also have this problem, the refrence count more than 1, if I release that node, memory will lost cause it.
I am worked use 2.0.3 and cocosbuilder rc 2.1. btw, my operation system is windows xp, not mac.
hi Minggo Zhang
has this problem be resolved in cocos2d-x-2.1.4?
i still have this problem in cocos2d-x-2.1.2?
Hello!
I also have the same problem with leak in CCBReader using cocos2dx 2.1.2.
Does anyone resolved that problem?