Releasing Memory

BlitzMax Forums/BlitzMax Beginners Area/Releasing Memory

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, if I have for example the following code:

type TObject
field image:Timage[10]
field x,y
...etc
endtype

global newObject:TObject
newObject = new TObject

Now say I wanted to delete newObject and release the memory of the object, I have been doing the following:

newObject = Null

...and I have been assuming that any fields within the type would release their memory as well.

But I have noticed that some code examplesI have encountered would first set all the images[] to null and then set newObject to Null.

Is its best to null the elements of a type and then the type or doesnt it matter?
Thanks