Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 70399 invoked from network); 2 Feb 2004 07:21:23 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Feb 2004 07:21:23 -0000 Received: (qmail 2779 invoked by uid 500); 2 Feb 2004 07:20:59 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 2711 invoked by uid 500); 2 Feb 2004 07:20:58 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 2688 invoked from network); 2 Feb 2004 07:20:57 -0000 Message-ID: <002301c3e95d$231bca40$6701a8c0@desktop2> From: "Stephen Ince" To: "APR Development" Subject: detecting apr memory leaks on windows Date: Mon, 2 Feb 2004 02:21:06 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0020_01C3E933.3665F000" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0020_01C3E933.3665F000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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_initialize(); apr_pool_create(&local_pool, NULL); apr_pool_destroy(local_pool); // apr_terminate(); #if defined(_DEBUG) && defined(WIN32)=20 OutputHeading( "Examine outstanding allocations (dump memory leaks)" = ); _CrtDumpMemoryLeaks( ); OutputHeading( "Program exits without freeing a memory block" ); SET_CRT_DEBUG_FIELD( _CRTDBG_LEAK_CHECK_DF ); #endif return EXIT_SUCCESS; } Steve ------=_NextPart_000_0020_01C3E933.3665F000 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
When does the real memory from a pool = actually get=20 destroyed. I am using VC++ 6.0 to try and debug memory leaks. I thought = that=20 apr_pool_destroy destroys the real memory. If I uncomment the line=20 apr_terminate(), all the memory is cleaned up. How can I immediately = destroy the=20 real memory from a top level pool?
 
I have the following code:
 
int main(int argc, char**=20 argv)
{
    apr_pool_t *local_pool;
   =20 apr_initialize();
    apr_pool_create(&local_pool, = NULL);
   =20 apr_pool_destroy(local_pool);
// apr_terminate();
#if = defined(_DEBUG)=20 && defined(WIN32)
   OutputHeading( "Examine = outstanding=20 allocations (dump memory leaks)" );
   _CrtDumpMemoryLeaks( = );
   OutputHeading( "Program exits without freeing a = memory block"=20 );
   SET_CRT_DEBUG_FIELD( _CRTDBG_LEAK_CHECK_DF = );
#endif
    return=20 EXIT_SUCCESS;
}
 
 
 
Steve
------=_NextPart_000_0020_01C3E933.3665F000--