Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Detected memory leaks!
Dumping objects ->
{850} normal block at 0x01363F28, 16 bytes long.
Data: < > CD CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.

I have a base class CCommonDlg derived from CDialog
then let CRegesterDlg derived from CCommonDlg
then let CEditUserDlg derived from CRegesterDlg
when I write this
m_pEditUser = new CEditUserDlg;
m_pEditUser->Create(CRegesterDlg::IDD,this);
m_pEditUser->SetUserInfo(&m_stUserInfo);
The memory leaks!
why ?
Posted
Updated 27-Jul-10 3:16am
v4

There is something 16 bytes long, that was allocated and presumably never initialized int the first 4 bytes that have never been deleted.

This is the only thing we can deduce from your post.
 
Share this answer
 
Buy a memory leak finder tool. There are several available.
 
Share this answer
 
Comments
henry3695 6-Jul-10 11:31am    
have some free software ,please tell me!
Stefan_Lang 18-Nov-11 6:07am    
There are a couple of free tools, but most are restricted to just a few OSs (the best are for Linux), and many are difficult to use, or at least come with little or no documentation. I've read an article that compared such tools a couple of years ago, but unfortunately can't find it any more. Try google for it.
Can you make m_pEditUser be not a pointer, but a stack variable? Then you would not need to create it with new and worry about deleting it.
 
Share this answer
 
You have memory leaks. You have no idea what you're doing, or you'd know that we can't help you based on this. Perhaps you need to read a basic C++ book on memory management ? If you want to post actual code, perhaps we can try to help you.

Also, don't push answer if you're not posting an answer. Edit your post to add detail. A lot of people only answer questions with no answers, they assume a response means you've been answered.
 
Share this answer
 
You could try to find the code region of your leak...

Just comment the function bodies,
function by function, until you have a "white" exit :)

Then - please analyze the last commented body,
find the leak-resolving line (usually: new/constructor/subfunction)
and improve it or/and post it here :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900