|
From: Mike S. <log...@pe...> - 2003-06-05 02:10:12
|
On Wed, 4 Jun 2003 gm...@gm... wrote:
> This boils down to the fact that the class BE keeps a class hash (implemented as
> an "our" or "my" lexical variable with package/file scope) that contains an
> array with references to each BE object instance. The reference to the array
> can be retrieved with BE->ALL.
That explains most of it, although I'm still puzzled why the debugger
doesn't show it.
> Any time a BE object goes out of scope, the @{BE->ALL} array still holds a
> reference to it, so DESTROY doesn't get to run until the entire program
> completes, at which time all other items in the interpreter (including
> Log::Log4perl) are already gone. Hence the problem, which is totally unrelated
> to Log::Log4perl.
>
> I've fixed the problem for two scenarios:
How about a wrapper class, each object carrying a BE object? If those
wrapper objects go out of scope, their DESTROY is called, and you can do
the cleanup of the contained BE object manually (e.g. by removing the
entry in ALL).
-- Mike
Mike Schilli
log...@pe...
http://perlmeister.com
http://log4perl.sourceforge.net
|