From: mpv Date: Thu, 30 Oct 2014 13:46:25 +0000 (+0300) Subject: Issue #189 : really close the root document X-Git-Tag: V_0.5~58^2~4^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c64d9021d8bba153678a0a34a4f073e28715b81a;p=modules%2Fshaper.git Issue #189 : really close the root document --- 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()