[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [ID 20000118.004] DynaLoader doesn't dlclose XS code on interpreter



On Thu, Jan 20, 2000 at 11:18:42PM +0000, Tim Bunce wrote:
> On Thu, Jan 20, 2000 at 01:14:42PM -0500, Ilya Zakharevich wrote:
> > Do not think so:
> > 
> > perl -wle 'sub a::new {bless [],"a"}; my $a="a"->new;END{print "<$a>"}'
> > <a=ARRAY(0xe2064)>
> 
> Ah, I see I confused PL_exitlist with PL_endav.
> 
> Looks like DynaLoader::bootstrap just needs to call perl_atexit(...)
> to register a callback to do the unloading after gobal destruction.
> (For versions of perl that have perl_atexit()).

In which case, I propose this: mod_perl can save a copy of
@DynaLoader::dl_librefs, and then call perl_destruct.  After that it
can attempt to dlclose() them; the dlclose() calls will fail (silently)
if the modules are already unloaded, and do the right thing if they
weren't.

It's a bit of a messy hack, but how's that sound for coping with
fixed/unfixed versions of DynaLoader?

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/


Follow-Ups from:
Tim Bunce <Tim.Bunce@ig.co.uk>
References to:
Alan Burlison <Alan.Burlison@uk.sun.com>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Tim Bunce <Tim.Bunce@ig.co.uk>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Tim Bunce <Tim.Bunce@ig.co.uk>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]