Hi!
I'm using Cocos2d 0.8.2. AlmoSprite inherits from Sprite:
@interface AlmoSprite : Sprite <StandardTouchDelegate>
I initialize my AlmoSprite like this:
m_backgroundImage = [[AlmoSprite spriteWithFile:@"SplashUbi_LogoUbi.png"] retain];
[m_backgroundImage init];
[self addChild: m_backgroundImage z: 2];
Later, I do this:
[self removeChild: m_backgroundImage cleanup:true];
[m_backgroundImage release]; // retain count is still 1 for some reason
m_backgroundImage = [[Sprite spriteWithFile:@"SplashJeu.png"] retain];
Dealloc never gets called on the first instance of this sprite. I've checked the retain count, and apparently it's still 1 after doing the release and removeChild. What extra step am I missing to get rid of this sprite entirely?
I don't have trouble with other sprites that I release during the onExit call on the owning layer, just ones that I try to release while the layer is running.