Flint Particle System Forum - How do I really kill all particles?2012-05-26T06:44:51+01:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
How do I really kill all particles?http://flintparticles.org/forum/comments.php?DiscussionID=554&Focus=1894#Comment_18942012-03-10T10:56:32+00:002012-05-26T06:44:51+01:00MikeBedarhttp://flintparticles.org/forum/account.php?u=599
I'm having an issue where I am doing several steps to remove particles after my effect is over and according to the memory profiler they are all stubbornly staying around.
Here is my cleanup code ...
Here is my cleanup code (copied largely from this forum):
var new_particle:Particle2D = ParticleCreator2D(emitter.particleFactory).createParticle() as Particle2D;
new_particle.image = new Bitmap(tile_bmd); new_particle.x = source_rect.x new_particle.y = source_rect.y
emitter.addParticle( new_particle, true )
//
Is there another step that I am missing? After calling the removal code all of the particles are still in memory(forever) and each time I run this process, while the particles ARE being reused, I am still using more memory each time around.
Any help would be appreciated.
Also, is there a way I could be making new particles directly from the BMD? I know there is the big factory function, but I need non-square bitmap particles.]]>
How do I really kill all particles?http://flintparticles.org/forum/comments.php?DiscussionID=554&Focus=1895#Comment_18952012-03-18T17:15:02+00:002012-05-26T06:44:51+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
The garbage colector only runs when the flash player needs more memory. So even though the data has been released, it will only be cleaned up when Flash runs the garbage collector and that may not be ...
Also, are you cleaning up the bitmap data from the particle images?]]>