|
-
December 8th, 2010, 07:38 AM
#1
DestroyWindow and delete, different memory cleanup?
I have class A derived from CDialog.
I have create and destroy objects of A many times I see different memory available after
delete a; ( a = new A.....)
and a->DestroyWindow();
Looking like DestroyWindow doesnot free memory.
Is it correct behaviour?
Thanks
-
December 8th, 2010, 07:41 AM
#2
Re: DestroyWindow and delete, different memory cleanup?
Yes it is.
DestroyWindow destroys the window (a MS Windows (TM) ) object. But it won't destroy the corresponding MFC object.
On the other side delete a will destroy both because the destructor of CDialog will call DestroyWindow.
Everytime think: Each new needs a corresponding delete.
With regards
Programartist
Last edited by ProgramArtist; December 8th, 2010 at 07:41 AM.
Reason: typo
-
December 8th, 2010, 07:48 AM
#3
Re: DestroyWindow and delete, different memory cleanup?
Thanks ProgramArtist
it is Ok.
delete is enough .
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
|