Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free memory of dialog resources

Status
Not open for further replies.

Huskey

Vendor
Aug 23, 2002
53
GB
Hi,

Can anyone please tell me how to free memory of dialog resources on program termination?

cheers,
 
Hi, your memory should be freed automatically once it goes out of scope. This includes program exiting. You can also ensure all memory associated with a dialog is released when you've finished with the dialog:

CDialog* myDialog = new CDialog;
myDialog->DoModal();
delete myDialog;
 
Hi,
right qednick.

In general, you have to free resources (object, memory-area)
(delete),
allocated by you, using new function, or malloc()...

Then if you use dialog without use new

CMyDialog myDlg() ;
myDlg.DoModal;

you have to free nothing.

bye
 
Hi,

Thank you for your reply. whenever I close the application, I got the memory leak problem:

Debug Error!
Program: C:\Program\Testing.exe
Damage: after Client block (#1210) at 0x0032F990
(Please retry to debug the application)

Abort Retry Ignore

I consulted few experts, and some told me I got to free the memory of dialog resources on program termination.

Please help. cheers,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top