httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Franky Braem <f.br...@skynet.be>
Subject Re: upload file crashes when using apr_pool_cleanup_register
Date Sun, 05 Mar 2006 18:50:44 GMT
Joe Schaefer wrote:
> Franky Braem <f.braem@skynet.be> 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);
}




Mime
View raw message