question:about Memory leak

question:about Memory leak
0.0 0


I create a scene and add in CCDirector ,then i create the second scene and i use function replacescene in CCDirector to replace the first scene. i destructor the first scene i find the memory leak.may be the scene does’t really release.


The first scene deconstructor shuld run automatically. If you are calling retain() on the first scene then the scene will not release. Are you calling retain() on the first scene anywhere? How are you creating the first scene? If you are new-ing the first scene you have to manually call autorelease()