Object deletion

BlitzMax Forums/BlitzMax Beginners Area/Object deletion

Adam Novagen(Posted 2012) [#1]
I'm still getting used to the OO and GC concepts of Max, so I wanted to check something with you lot. If I have something like this:

Type blob
    Method doStuff()
        '...
    EndMethod
EndType


Local thisBlob:blob = New blob

blob.doStuff()

blob = Null
This constitutes a manual Delete call in procedural Blitz, right? Since nothing else points to that instance of blob, it'll be deleted on the next GC pass?

EDIT: Changed blob = 0 to blob = Null because herp de derp.

Last edited 2012


TAS(Posted 2012) [#2]
Correct, unless the New method for blob adds thisblob to a global TList, a very common practice.

Also;
blob.doStuff()
blob = Null

should be;
thisblob.doStuff()
thisblob = Null


Adam Novagen(Posted 2012) [#3]
Whoops, yeah missed that. I do actually know the difference, embarrassing to have that slip-up caught. XD