apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Ince" <si...@opendemand.com>
Subject detecting apr memory leaks on windows
Date Mon, 02 Feb 2004 07:21:06 GMT
When does the real memory from a pool actually get destroyed. I am using VC++ 6.0 to try and
debug memory leaks. I thought that apr_pool_destroy destroys the real memory. If I uncomment
the line apr_terminate(), all the memory is cleaned up. How can I immediately destroy the
real memory from a top level pool?

I have the following code:

int main(int argc, char** argv)
    apr_pool_t *local_pool;
    apr_pool_create(&local_pool, NULL);
// apr_terminate();
#if defined(_DEBUG) && defined(WIN32) 
   OutputHeading( "Examine outstanding allocations (dump memory leaks)" );
   _CrtDumpMemoryLeaks( );
   OutputHeading( "Program exits without freeing a memory block" );
    return EXIT_SUCCESS;

View raw message