Memory leaks...  on a CDialog

Posted on 2001-06-14
Last Modified: 2013-11-20
Hi all,
      just want to know if any of you are familiar with this memory leak :

I just open my Dialog and close it...

Detected memory leaks!
Dumping objects ->
{41} client block at 0x004925D0, subtype 0, 64 bytes long.
a CDynLinkLibrary object at $004925D0, 64 bytes long
a CDynLinkLibrary object at $004925D0, 64 bytes long
Object dump complete.

Wow, how fun... :)
Question by:David MacDonald
  • 2
  • 2
  • 2
  • +2
LVL 42

Expert Comment

ID: 6191046
can u add some coed from your CDialog??

did u try to dbl-click on the mem-leak line sometimes u get to the line where the memory is leaking
LVL 42

Expert Comment

ID: 6191051
r u using dll's?
LVL 10

Expert Comment

ID: 6192075
is your CDialog of the heap, if so delete it when you are finished with it

CDialogDerived *dd = new CDialogDerived();
delete dd;

hopet this helps
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.


Author Comment

by:David MacDonald
ID: 6192175
Yes, i'm using 2 dll's ... but double-clik not working

The Dlg is on the frame...  

the dll's are loaded direct at the start... maybe they are the cause.... hmmmm...

Ok ... i'll try to look for a leak in the dll's... i'll keep you posted...

LVL 31

Accepted Solution

Zoppo earned 100 total points
ID: 6194225
Hi Moonover,

maybe it's not a bug at all ... tak a look at this MSDN article:
'PRB: Memory Leaks Reported When Using Multiple MFC DLLs ID: Q167929'


Expert Comment

ID: 6194595
I agree with zoppo not all leaks reported are actually leaks

to test this put a breakpoint on the constructor of CDynLink and write down the address

then put a break point in  the destructor and see if it is called with the correct address of the original object - if the destructor is being called but it is still reporting as a leak then it is a 'feature' of the leak reporting.

This is made easier obviously if you only have 1 CDynLinkLibrary being created (1 per DLL) adn if it stays at the same allocation number (eg in your case {41} )

Author Comment

by:David MacDonald
ID: 6196476
Thanks Zoppo, exactly that...

i'll remember that... you can be sure
LVL 31

Expert Comment

ID: 6201364
you're welcome...

have a nice day,



Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 124
Prevent this page from creating additional dialogs. 3 524
difference between String.subString() and String.subSequence() 6 194
EvenOdd challenge 10 107
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question