# define _CRTDBG_MAP_ALLO
#include
At the end of the each function add _CrtDumpMemoryLeaks ();
When to generate pop-up window will display memory leaks, minimize afresh again open also can prompt disclosure
C: \ documents and Settings \ administrator \ \ distanceview desktop CPP (32) : {727} client block at 0 x01549df8, subtype c0, 928 bytes long.
A CDistanceView object df8 at $01549, 928 bytes long
F: \ dd \ vctools \ vc7libs \ ship \ atlmfc \ SRC \ MFC \ strcore CPP (156) : {723} normal block x01549bd0 at 0, 25 bytes long.
Data: & lt; T y & gt; 54 CD 07 79 08 00 00 00 00 00 00 08 01 00 00 00
F: \ dd \ vctools \ vc7libs \ ship \ atlmfc \ SRC \ MFC \ strcore CPP (156) : {722} normal block x01549b78 at 0, 25 bytes long.
Data: & lt; T y & gt; 54 CD 07 79 08 00 00 00 00 00 00 08 01 00 00 00
F: \ dd \ vctools \ vc7libs \ ship \ atlmfc \ SRC \ MFC \ strcore CPP (156) : {721} normal block at 0 x01549af0, 69 bytes long.
Data: & lt; T y4 4 & gt; 54 CD 07 79 34 00 00 00 00 00 00 01 00 00 00
Pointers to the IMPLEMENT_DYNCREATE CDistanceView, CFormView,
C: \ documents and Settings \ administrator \ \ mainfrm desktop CPP (18) : {720} client block at 0 x01549808, subtype c0, 680 bytes long.
A CMainFrame object at $01549808, 680 bytes long
Pointing to the IMPLEMENT_DYNCREATE (CMainFrame CFrameWnd)
C: \ documents and Settings \ administrator \ \ desktop qualitative 4.7 continuous \ distancedoc CPP (18) : {719} client block at 0 x015496e0, subtype c0, 236 bytes long.
A CDistanceDoc object e0 at $015496, 236 bytes long
Pointing to the IMPLEMENT_DYNCREATE (CDistanceDoc CDocument)
C: \ documents and Settings \ administrator \ \ desktop qualitative 4.7 continuous \ short CPP (76) : {715} client block at 0 x01549478, subtype c0, 140 bytes long.
A CSingleDocTemplate object at $01549478, 140 bytes long
Point to pDocTemplate=new CSingleDocTemplate (
There are many is f: \ dd \ vctools \ vc7libs \ ship \ atlmfc \ SRC \ MFC \ * * * * * * * * * * * at the beginning of
Check the memory leak for the first time, there are a lot of things are not clear, after should reveal how to judge?
CodePudding user response:
In each function is added _CrtDumpMemoryLeaks not fault, at the end of the program to add ah,_CrtDumpMemoryLeaks snapshot is contrast examination within what memory did not release, we generally say the memory leak is not released no longer use memory,
There must be some in the operation of the no release, but still in use
CodePudding user response:
MFC already bring the function of memory leak detection, can tryCodePudding user response: