The dangers of automatic GC mode

BlitzMax Forums/BlitzMax Programming/The dangers of automatic GC mode

I don't rely on GC to free entities themselves because their relationships with each other are far too complicated for the default GC. Parents reference children, children reference parents, each entity is stored in a global list, as well as scene graph lists.

If the relationships get that complicated, it might be a good time to ask if it's necessary. Maybe it is, but sounds like there might be some unnecessary complexity in the design.

Other than that, the way to handle your problem might be another list for to-be-freed objects that gets emptied once a frame. That lets the GC free some memory in the middle of loops, but makes sure global lists maintain their state.