in reply to Re: Building an object tree
in thread Building an object tree
The problem only comes if children keep track of their parents. For instance consider a directory tree. Each directory uses "." and ".." to keep track of itself and its parent. What this means is that when the last external reference to a directory tree goes away, the tree hangs around because it refers to itself.
If you wish to get around this you will need to be using Perl 5.6.x or higher, and you will need to install the WeakRef module. (OK, there are other ways, but this one is the simplest.) Then weaken all of the links that cause recursion, and no more memory leaks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 2: Building an object tree
by MeowChow (Vicar) on Feb 26, 2001 at 03:59 UTC | |
by tilly (Archbishop) on Feb 26, 2001 at 05:25 UTC |