> You could try using a PerlCleanupHandler to kill any open locks.
>
> $r->register_cleanup( \&clear_locks );
>
> - Perrin

Perrin,

Thanks a lot.  This worked great :-).  Actually, as I say, I'm wrapping to
Apache::Session with another object that handles cookies, expiration, etc.
I just registered a cleanup sub within the constructor for that object.

Looks like:
Apache->request->register_cleanup(sub {$self->DESTROY; print STDERR
"Destroyed the Object\n";});

Since we're inside the constructor and $self is already a reference to the
object hash, the cleanup handler knows how to destroy this object.  I
couldn't achieve the same thing with a $SIG{__DIE__} = sub {...} because
$main would then include a reference to the object.  So in cases where the
script did not die, the object would never go out of scope (because there's
still an outstanding reference to it).

Thanks again,
Russ

Russell Weiss
Founder and Technical Manager
InfoRelay Online Systems, Inc.
http://www.InfoRelay.net/


Reply via email to