Edit

Share via


Cleaning Up Documents and Views

When a document is closing, the framework first calls its DeleteContents member function. If you allocated any memory on the heap during the course of the document's operation, DeleteContents is the best place to deallocate it.

Note

You should not deallocate document data in the document's destructor. In the case of an SDI application, the document object might be reused.

You can override a view's destructor to deallocate any memory you allocated on the heap.

See also

Initializing and Cleaning Up Documents and Views