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
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
Re: DestroyWindow and delete, different memory cleanup?
Thanks ProgramArtist
it is Ok.
delete is enough .