]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Document.cpp
Salome HOME
Fixes for porting to OCCT 7.5.0
[modules/shaper.git] / src / Model / Model_Document.cpp
index 5b68969e887510ec3353e12cbb8d1322aa3d72bc..8fec2926d90a8ddc97e45aa0958d33772b171a12 100644 (file)
@@ -132,6 +132,15 @@ Model_Document::Model_Document(const int theID, const std::string theKind)
   myDoc->CommitCommand();
 }
 
+Model_Document::~Model_Document()
+{
+  if (!myDoc.IsNull())
+  {
+    myDoc->ClearUndos();
+    myDoc->ClearRedos();
+  }
+}
+
 void Model_Document::setThis(DocumentPtr theDoc)
 {
   myObjs->setOwner(theDoc);
@@ -331,6 +340,8 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum
     aSession->setCheckTransactions(false);
     if (myObjs)
       delete myObjs;
+    anOldDoc->ClearRedos();
+    anOldDoc->ClearUndos();
     anOldDoc.Nullify();
     myObjs = new Model_Objects(myDoc->Main()); // synchronization is inside
     myObjs->setOwner(theThis);