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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for