Joe Schaefer wrote:
Franky Braem <[EMAIL PROTECTED]> writes:


The following code crashes when I remove the comment before the
apr_pool_cleanup_register (and put apr_file_close into comment
ofcourse).


I *think* it's because apr_file_open registers a pool cleanup automatically.
So you don't need to register the cleanup, you wind up closing the file
twice when you do that.


Yep, you're right. Saw this in open.c:

if (!(flag & APR_FILE_NOCLEANUP))
{
  apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup,
                            apr_pool_cleanup_null);
}



Reply via email to