Memory Corruption

From MPSWiki
Revision as of 15:35, 31 October 2019 by Svan (talk | contribs) (Created page with "In the stack find first place the problem can appear and put: _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF ); _CrtCheckMemory(); T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In the stack find first place the problem can appear and put:

_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF );

_CrtCheckMemory();

Then in each function put _CrtCheckMemory(); before and after functions that can lead to problem


For the memory corruption finding: find a place where the possible problem can appear. Call

{,,msvcr90d.dll}_CrtCheckMemory() in watch to ensure the result of function is 1.

Do next step in debug and again call {,,msvcr90d.dll}_CrtCheckMemory() to check the result.

Tags: memory, corrupt, leak, problem.