apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: Changing the order of cleanup for some core objects
Date Wed, 23 Jul 2008 08:07:14 GMT
Bojan Smojver wrote:
>> destructor(res) {
>>      socket_shutdown(res->sock);
>>      socket_close(res->sock);
>> }
> If we follow the design pattern Joe explained, we should not do the
> above. Most definitely will segfault.

That's my point.
The API is very unclear in that case and you *must* follow
certain rules. Again you cannot call pool_create in constructor
and then pool_destroy in destructor without segfaulting, and
that bring us to the original problem.

Also additional pool is always created for each resource which
might not be what user needs (not to mention the API change
in that case, since original says that constructor is provided
with the pool used for apr_reslist).


View raw message