[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: AW: Python bindings: Use of svn_swig_py_make_stream() - avoiding leaking fds

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Mon, 09 May 2011 16:37:53 +0100

Daniel Shahaf <danielsh_at_elego.de> writes:

>> @@ -73,6 +95,9 @@ svn_stream_create(void *baton, apr_pool_t *pool)
>> stream->mark_fn = NULL;
>> stream->seek_fn = NULL;
>> stream->buffered_fn = NULL;
>> + stream->pool = pool;
>> + apr_pool_pre_cleanup_register(stream->pool, stream,
>> + close_stream_cleanup);
>
> Why did you switch to apr_pool_pre_cleanup_register() from
> apr_pool_cleanup_register()?

I guess it's because the pool cleanup function can't deregister the
cleanup after the pool has been destroyed. The alternative is to
reorganise the functions: move the guts of svn_stream_close into a new
close_body, have svn_stream_close call deregister and close_body, have
the pool cleanup call close_body without deregistering.

-- 
Philip
Received on 2011-05-09 17:38:30 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.