]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Application.cpp
Salome HOME
Correctly close the document on opening the new one
[modules/shaper.git] / src / Model / Model_Application.cpp
index 23ecf05ae7f2109317f435566ad88d2b17a63c2a..d53dc665c679dcd14f69eca5b2881a10655b910b 100644 (file)
@@ -40,7 +40,17 @@ const boost::shared_ptr<Model_Document>& Model_Application::getDocument(string t
 
 void Model_Application::deleteDocument(string theDocID)
 {
-  myDocs.erase(theDocID);
+  if (myDocs.find(theDocID) != myDocs.end()) {
+    myDocs[theDocID]->close(true);
+    myDocs.erase(theDocID);
+  }
+  myLoadedByDemand.clear();
+}
+
+void Model_Application::deleteAllDocuments()
+{
+  myDocs.clear();
+  myLoadedByDemand.clear();
 }
 
 //=======================================================================