Johan Corveleyn <jcor...@gmail.com> writes: > Looking at the source code I see: > - get_dir_contents calls read_representation > - read_representation calls rep_read_get_baton, which creates a > rep_read_baton and opens the rev file inside build_rep_list -> > create_rep_state -> create_rep_state_body > - read_representation wraps it in a stream, and sets the close > function to rep_read_contents_close > - get_dir_contents reads stuff and closes the stream > > Now, the close callback of the stream is rep_read_contents_close, which is: > [[[ > static svn_error_t * > rep_read_contents_close(void *baton) > { > struct rep_read_baton *rb = baton; > > svn_pool_destroy(rb->pool); > svn_pool_destroy(rb->filehandle_pool); > > return SVN_NO_ERROR; > } > ]]] > > Apparently, this does not close the file. After this callback is run, > neither svn_io_file_close nor apr_file_close are being executed.
You have the wrong function name. Look at apr_file_open in http://svn.apache.org/repos/asf/apr/apr/trunk/file_io/unix/open.c to see the pool cleanup handler, it's on the pool passed in (unless the flag APR_FILE_NOCLEANUP is used), so that should be result_pool in svn_stream_open_readonly which ends up being rb->pool. You should be able to set a breakpoint on the function apr_unix_file_cleanup (or file_cleanup on Windows) to catch the close. -- Philip