[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [paragui-users] a tool
From: |
taurus |
Subject: |
Re[2]: [paragui-users] a tool |
Date: |
Sun, 18 Aug 2002 18:09:10 +0100 |
Hello John,
Thanx a lot, John! It is useful!
Saturday, August 17, 2002, 8:07:52 PM, you wrote:
JP> I use the supplied debug routines. Just add this include:
JP> #include <crtdbg.h>
JP> and then add this:
JP> _CrtSetDbgFlag(
JP> _CRTDBG_ALLOC_MEM_DF | _CRTDBG_DELAY_FREE_MEM_DF |
JP> _CRTDBG_LEAK_CHECK_DF
JP> );
JP> in your 'main' as near as possible to the start of execution.
JP> It will alert you to memory leaks, multiple free problems,
JP> accessing freed memory, corruption of the heap by overwriting
JP> the beginning and end of a memory block etc. Checkout the
JP> documentation.
JP> My favourite is when a memory leak is reported (on exit) it is
JP> given an ID that can be used in _CrtSetBreakAlloc( ID ); to break
JP> execution at the point where this block is being allocated (on a
JP> second identical run).
JP> The only downside is that if the flag to check on every alloc/free
JP> (_CRTDBG_CHECK_ALWAYS_DF) is used, execution can slow to a crawl.
JP> Works for C and C++ programs - all you have to do is add the above
JP> lines, recompile, and relink,
JP> cheers,
JP> John.
JP> ----- Original Message -----
JP> From: "taurus" <address@hidden>
JP> To: "paragui" <address@hidden>
JP> Sent: Friday, August 16, 2002 8:27 PM
JP> Subject: [paragui-users] a tool
>> Hello,
>>
>> Can anybody tell me what the utility (a good one) I can use to
>> track down the memory licks and possible pointer loss in Windows
>> app, working in Visual Studio 6.0?
>>
>> I`m trying to hunt the bug which cause my paragui application
>> explode in very unusual places :( For instance, on freeing the
>> object or SDL surface...
>>
Kind regards,
taurus
address@hidden
->> "If you will have a megaphone, you will never have to be alone..."