Whys it causing a memory leak? (types and lists)

BlitzMax Forums/BlitzMax Beginners Area/Whys it causing a memory leak? (types and lists)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I'm not clear what Release actually does (Yes I've read the docs).

As I understand it the memory used by a type instance is freed at the next flushmem once all references to it are gone. In the inital example p still pointed to the last instance so flushmem couldn't remove it. If the loop was placed in a function - kill_all_particles() then p would likely be local to that function and destroyed automatically. So there would be no memory leak.