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!
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!