ios - CCParticleSystemQuad not getting deallocated when added to a moving sprite -


i trying add particle trail effect in cocos2d, managed adding ccparticlesystemquad emitter child moving sprite. observing emitter not getting deallocated eventually.

if add emitter same sprite, keep still , dont move @ all, emitter deallocated.

i cant figure out why happening..

code this..

ccparticlesystemquad *emitter = [[[ccparticlesystemquad alloc] initwithfile:@"myeffect.plist"] autorelease]; emitter.positiontype = kccpositiontypefree; emitter.autoremoveonfinish = yes; [movingsprite addchild:emitter z:movingsprite.zorder + 1000]; 

make sure called [emitter removefromparentandcleanup:yes];

here 1 of similar question

find out object retained, follow morion's answer in above thread.

quick solution:

ccparticlesystemquad *emitter = [ccparticlesystemquad particlewithfile:@"myeffect.plist"]; emitter.positiontype = kccpositiontypefree; emitter.autoremoveonfinish = yes; [movingsprite addchild:emitter z:movingsprite.zorder + 1000];  //to remove [emitter stopsystem]; [emitter removefromparentandcleanup:yes]; 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -