TList.Clear - do I have to worry about anything?

BlitzMax Forums/BlitzMax Beginners Area/TList.Clear - do I have to worry about anything?

anawiki(Posted 2005) [#1]
If I use clear method of tlist do I have to manualy delete stored objects (ie. images) or tlist will delete them for me?

thanks
Roman


Ferminho(Posted 2005) [#2]
If you *only* have references to those TImages in the list, when you do a Clear the Garbage Collector will dispose of them (when, depending if you have it on auto or manual).

Care only about references. References inside a list are lost when the list is cleared, AFIIK. If you have references in other lists or whatever you have to dereference them too

Hope it helps


tonyg(Posted 2005) [#3]
If you remove the object links from the list then GC will release the used memory when the object variable is reused, goes out of scope or is set to null.