More Memory Questions

BlitzMax Forums/BlitzMax Programming/More Memory Questions

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I've requested weak references for BMax before, but no reply. I don't see any necessity for it to manage circular references though. If your design requires circular references ( and I accept that for the sake of speed, this does happen ) then you know you've done it, so you know you have to break them when you're finished with the objects involved.

Weak references would be handy for writing modules, libraries, etc where you may wish the module or library to hold internal references to objects which can also be used by the person using your library too. This way the person using your library can allow his or her own objects to be disposed as one should in a managed environment. If the engine needs a copy of those objects for it's internal purposes, they should be weak references or else they will never be collected and you have to have an explicit destroy method for your user to call, which defeats the object of having an automated GC.