Mem leack in my particle emittor code.

BlitzMax Forums/BlitzMax Beginners Area/Mem leack in my particle emittor code.

Because particle.update() and particle.destroy() should be in the For ... EachIn loop you defined above - in the code's current state, you don't know what "particle" is referring to.

By the way, there's some bad programming practice you've got there! I feel there should be no tests or loops in your type's functions - those should be handled in your main loop. I can't see how your code's managing to create the particles in the first place - you're calling the create method on an object called 'particle' which hasn't been instantiated. Funny that!

Ryan