dev  

Re: Changing the order of cleanup for some core objects

Bojan Smojver
Tue, 22 Jul 2008 23:45:26 -0700

On Wed, 2008-07-23 at 08:34 +0200, Mladen Turk wrote:

> If you create a socket for example in the constructor,
> socket registers it's own cleanup. This cleanup will be run
> *before* destructor meaning you are convicted to apr_socket_close,
> and you cannot cleanly close the socket via shutdown, or send
> some data upon destruction.

Hang the custom shutdown as cleanup against your socket's pool and this
will then run before the socket is shut down.

> Also any sub pool created is destroyed before destructor is
> called, so, the same story again, but with one level deeper.

Ditto.

No good?

-- 
Bojan