dev  

Re: Changing the order of cleanup for some core objects

Mladen Turk
Mon, 21 Jul 2008 04:13:20 -0700

Joe Orton wrote:

In the model where you have S allocated out of P, let's presume we also have a subpool Q.

If for some reason specific to the design of your application, you need S to be closed before the destruction of Q, you can register a cleanup against Q which does calls apr_socket_close(S). That will give defined behaviour.


That's fine, but then if I explicitly close the S I have to deregister
the cleanup for Q, close the S, and then register the cleanup for Q
again. That's how its done now in multiple places where APR is used.
I need additional pool and additional cleanup for the exact behavior that pre_cleanup does. Also this pool has to be the 'last'
one registered, so adding any dependent child pools to P requires
deregister/register of Q so its assured it's callback is run first.

The pre_cleanup stuff seems to be entirely redundant in this regard. I don't understand the motivation for it in the first place, to be honest.


See above.

Regards
--
^(TM)