apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: Changing the order of cleanup for some core objects
Date Wed, 23 Jul 2008 06:44:24 GMT
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.


No good?


View raw message