Danger of null List Items?

BlitzMax Forums/BlitzMax Programming/Danger of null List Items?

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.

Or won't the garbage cleaner clean it because it knows the list is using it, and then when the list is finally freed, it will clean up all the Local Line variables that were made. Is this how it works?


Yes, that's how it works. You'd probably want to ask FlameDuck or one of the most experienced OO programmers, but it's my understanding that if you're using the purest OO design, you rarely have references to specific objects. The purpose of OO design is that objects should be self-contained, and you should therefore not need to handle them outside the object.

In my GUI I'm currently writing, I have no handles to any of the GUI gadgets. They're held in one ( or more ) lists and when the gadget is freed, they automatically remove themselves from every list they're in. Thus they will be cleaned up by the GCC when it's ready.