in reply to Circular references and Garbage collection.

There are several strategies to break circular references.

The simplest for many applications is to protect your entire circular datastructure with an object that you use to access it. Then give that object a DESTROY method that breaks all of the internal references so the entire mess will be garbage collected in time.

  • Comment on Re: Circular references and Garbage collection.