- wxDocument *doc = (wxDocument *)node->Data();
- wxNode *next = node->Next();
-
- if (!doc->Close())
- return FALSE;
-
- // Implicitly deletes the document when the last
- // view is removed (deleted)
- doc->DeleteAllViews();
-
- // Check document is deleted
- if (docManager->GetDocuments().Member(doc))
- delete doc;
-
- // This assumes that documents are not connected in
- // any way, i.e. deleting one document does NOT
- // delete another.
- node = next;