More Memory Questions

BlitzMax Forums/BlitzMax Programming/More Memory Questions

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.

Does anyone know why circular references are not freed?

Because of the very fact that they are circular. ie. A points to B which points to A.

If B is a child of A, then you can build into your A.free() a case where it removes it's children, which in turn causes say, B.free() to be called, which you set to null out the reference to A.

Unless you build your code in such a way as you know that your own code will clean itself up properly, you should really stay clear of circular references if you can. (It's certainly possible to design code that doesn't need them)