]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #189 : really close the root document
authormpv <mikhail.ponikarov@opencascade.com>
Thu, 30 Oct 2014 13:46:25 +0000 (16:46 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Thu, 30 Oct 2014 13:46:25 +0000 (16:46 +0300)
src/Model/Model_Document.cpp

index 6251a36d85f6539a25c8c074630101882edda762..cbf4ac79d96563fd982c26ea2fe79d3fdec2aaa0 100644 (file)
@@ -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()