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.

Maybe because it is essentially initializing the variable. As I understand it, p = Null is the same as p = 0. Maybe that's the reason?



No - all objects are Null when they are created. p=Null is effectively 'unlinking' the variable p from the object it references. Hence subsequent calls to FlushMem would delete the object previously referenced by p.