cocosbuilder can't release cclayer create by ccbi files

cocosbuilder can't release cclayer create by ccbi files
0.0 0


hi all,

i create custom layer by ccbi


CCNode ***nodeLayer =ccbReaderLayer->readNodeGraphFromFile;
**menuLayer = static_cast<MainMenu >;
CCScene *scene = CCScene::create;
it’s ok by now
when i replace this scene by another, just like game scene, the MainMenu\ func\ can\ not\ be\ called.
and\ i\ found\ the\ code\
\ if\ )
\ {
\ mActionManager->setRootNode;
\ }
CCBReader.cpp\ line\ 558
“node”\ is\ the\ instance\ of\ “MainMenu”,\ and\ i\ change\ the\ code\ setRootNode\ like\ this\
void\ CCBAnimationManager::setRootNode
\ mRootNode\ =\ pRootNode;
MainMenu func be called correctly.
so i guess
menuLayer has the reference of the mActionManager, and mActionManager has the reference of _menuLayer.

so you can not release any of them in fact.

i want to know if it is reason i can’t release the custom cclayer?

or i need to add some code to release them ?



I came cross this issue whenever I load a node from ccbi file;
The rootNode will call setUserObject(mActionManager) which will retain mActionManager;
So it’s an obviously cycle reference issue;