Stas Bekman wrote:
Geoffrey Young wrote:


it's probably better to have a new 'sub cleanup_sub_pool', otherwise how do we know that it's not the main pool that gets destroyed twice?

  +    # should destroy the subpool too, so
  +    # cleanup is called twice
       $p->destroy;




also should we test that a sub-pool is destroyed before the main pool?



how about this


+1, but could also do:

sub cleanup {
    my ($r, $what) = @{+shift};
    $r->notes->add(cleanup => $what);
    1;
}
...
$p->cleanup_register(   \&cleanup, [$r, 'parent']);
$subp->cleanup_register(\&cleanup, [$r, 'child']);

the idea was that one calls set and one calls add - although table order is guaranteed, so it shouldn't be an issue, if the parent pool is destroyed before the child then only one appears in notes (as opposed to them being in a different order).



either way is good, just trying to put new features to stress ;)


also will this call destroy on $p on the exit from { } ?

{
    my $p = APR::Pool->new;
}

I think it should.

I'll add that too.


--Geoff


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to