From c64d9021d8bba153678a0a34a4f073e28715b81a Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 30 Oct 2014 16:46:25 +0300 Subject: [PATCH] Issue #189 : really close the root document --- src/Model/Model_Document.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 6251a36d8..cbf4ac79d 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -210,12 +210,12 @@ void Model_Document::close() for (; aSubIter != mySubs.end(); aSubIter++) subDoc(*aSubIter)->close(); mySubs.clear(); - // close this - /* do not close because it can be undoed - if (myDoc->CanClose() == CDM_CCS_OK) - myDoc->Close(); - Model_Application::getApplication()->deleteDocument(myID); - */ + // close this only if it is module document, otherwise it can be undoed + if (this == aPM->moduleDocument().get()) { + if (myDoc->CanClose() == CDM_CCS_OK) + myDoc->Close(); + Model_Application::getApplication()->deleteDocument(myID); + } } void Model_Document::startOperation() -- 2.39.2