|
-
Oct 1st, 2002, 09:55 AM
#1
Thread Starter
Hyperactive Member
[Resolved]Memory Detection Problem
This is a attempt I try to learn memory leak detection. I used a working MFC SDI app which I wrote a month ago. No memory leak detected. So I purposely do a memory allocation and never deleted it.
Fine. Memory leak detected with the errant line reported.
If I tried moving the memory leak code to my added source(not Appwizard generated file) to the project, the object dump did not include the file and line which caused the leak eventhrough I define _CRTDBG_MAP_ALLOC in every source as previously. Pls note the SDI app is a completely working app.
This is a source of problem for me because 50% of my code resides in this source file(not by Appwizard) written by me. This source makes use of MFC classes as well.Of course, originally there is no leaks, it is generated by me.
I replicated the same problem with a new, this time, MFC Dialog app. the leak(1st) in the added source has no line number and no source file indicated. But the one(2nd) in MFC has. Msg as below
"Detected memory leaks!
Dumping objects ->
{42} normal block at 0x01491FA0, 80 bytes long.
Data: < > 10 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD
E:\PROGRAMMING PROJECTS\VC PROJECTS\CStringLeak\CStringLeakDlg.cpp(179) : {41} normal block at 0x014900A0, 40 bytes long.
Data: < > 04 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete."
I used _CrtDumpMemoryLeaks() to do a code dump. Below is the preprocessor
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
at the top of every source files.
Please help me as I usually code my own class to be used together with MFC generated ones.
Last edited by transcendental; Oct 1st, 2002 at 11:09 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|