I have an ios app that uses cocos2d v1.1.0-beta2b, and encountered a very strange condition with emitters' auto removal.
My question is:
Is there any way that an infinite duration CCParticleSystemQuad, with an autoRemoveOnFinished set to YES, will be removed before I call stopSystem?
Here is some additional info:
I initialize the emitter as follows:
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
emitter = [[[CCParticleSystemQuad alloc]
initWithDictionary:dict] autorelease];
emitter.duration = -1.0f;
[emitter setAutoRemoveOnFinish:YES];
[self addChild:emitter z:10];
Then, it is of course added as a child and everything works perfectly. As suggested in many places, in order to remove it I call:
[emitter stopSystem];
After that, when all the particles are gone the emitter is removed as expected.
So far all is well.
However, I've encountered several crash reports that indicate that the emitter is released prematurely, and then my app crashes on the stopSystem line (as emitter is already released). I got several feedbacks that indicate that it sometimes happen when the device is locked/unlocked during the emitter activity, though for me it works and these crashes are rare. I haven't been able to reproduce the circumstances under which it happens, so I ask you guys again:
Is there any way that an infinite duration CCParticleSystemQuad, with an autoRemoveOnFinished set to YES, will be removed before I call stopSystem?