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.

Hi,

Yes, Release seems to be killing it.

Release is only really for integer handles, eg: if you've gone...

Local my_image=LoadImage( blah ) 'Note: my_image is an int

...then you must "Release my_image" later to avoid a leak.

If you are using object variables instead of ints, there is no real need for Release but...

BlitzMax *does* let you use Release on an object variable, in which case all it does is set the variable to Null. I should NOT have done this as it looks like it's only confusing things. It also appears to be broken, judging by your demo!

Anyway, you can safely remove all Releases and =Nulls from this code and there's no leak. In fact, you can pretty much remove all Releases and =Nulls from all the code I've seen posted here to date!