CCBProxy may cause a leak

CCBProxy may cause a leak
0.0 0


I use lua script to load ccbi file, and encounter a memory leak.see my upload image file.
I found that every time call CCBProxy::createCCBreader method, would create a new CCBLayerLoader object, and register to CCNodeLoaderLibrary,
but never unregister. I think it might cause leak.
CCBReader* CCBProxy::createCCBreader()
CCNodeLoaderLibrary *ccNodeLoaderLibrary = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
CCBReader * pCCBReader = new CCBReader;
return pCCBReader;

Screen Shot 2013-08-29 at 上午11.19.51.png (96.6 KB)


CCBLayerLoader never call unregister,so it really cause leak.Now, the NodeLoaders CCBProxy used are all default registered in CCNodeLoaderLibrary:registerDefaultNodeLoaders,so we can delete@ ccNodeLoaderLibrary->registerCCNodeLoader(β€œβ€, CCBLayerLoader::loader());@