[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 08:40:23PM -0500, Daniel Jacobowitz wrote:
> 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.

That's a presumption, but probably true on most platforms. For some
you might get a core dump. You could configure your way around that.

Tim.


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>
Daniel Jacobowitz <drow@false.org>

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