I'm using cocos2d 0.7.1 and am running into problems releasing a ParticleSystem object. After the memory is released, my game crashes as if a bad pointer is being accessed.
You can reproduce the crash even in the ParticleDemo.
For example if you change this...
@implementation DemoFlower
-(void) onEnter
{
[super onEnter];
ParticleSystem *emitter = [ParticleFlower node];
[self addChild: emitter z:0 tag:kTagEmitter];
}
...into this (so the ParticleSystem is created then just released right away) then the demo will crash:
@implementation DemoFlower
-(void) onEnter
{
[super onEnter];
ParticleSystem *emitter = [ParticleFlower node];
[emitter release]; // [emitter dealloc] causes crash too
//[self addChild: emitter z:0 tag:kTagEmitter];
}
Am I not releasing the memory for a ParticleSystem correctly? Are there any known issues with ParticleSystem memory management?