CDocument::~CDocument() { // do not call DeleteContents here ! #ifdef _DEBUG if (IsModified()) TRACE0("Warning: destroying an unsaved document.\n"); #endif // there should be no views left! DisconnectViews(); ASSERT(m_viewList.IsEmpty()); if (m_pDocTemplate != NULL) m_pDocTemplate->RemoveDocument(this); ASSERT(m_pDocTemplate == NULL); // must be detached }
COleLinkingDoc::~COleLinkingDoc() { AFX_BEGIN_DESTRUCTOR ASSERT_VALID(this); ASSERT(!m_bVisibleLock); DisconnectViews(); ASSERT(m_viewList.IsEmpty()); Revoke(); // cleanup naming support ExternalDisconnect(); AFX_END_DESTRUCTOR }