Dear All,
I have a problem with using stdout stream opened by apr_file_open_stdout()
function. If I open several stdout handlers in my program then it crashes
when calls apr_file_close() function more than one time.
The following simple code reproduces such error:
int main(int a, char** b)
{
apr_pool_t * pool;
apr_file_t *file1, *file2;
apr_initialize();
apr_pool_create(&pool, NULL);
apr_file_open_stdout(&file1, pool);
apr_file_open_stdout(&file2, pool);
apr_file_puts("Hello World (1)\n", file1);
apr_file_puts("Hello World (2)\n", file2);
apr_file_close(file1);
apr_file_close(file2); // <-- crash is here.
apr_terminate();
return(0);
}
-------------------------------------------------
System: WinXP SP3, x86.
APR: 1.3.8
Compiler: Visual Studio 2008 SP1 (15.00.30729.01)
Is this bug or feature?
Regards,
Yura Vishnevskiy