From: mpv Date: Thu, 28 Jan 2021 12:47:29 +0000 (+0300) Subject: Fixes for porting to OCCT 7.5.0 X-Git-Tag: V9_7_0a1~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b5b8fdb4cb0eb35b301f7c37dd946aac2bdeef2;p=modules%2Fshaper.git Fixes for porting to OCCT 7.5.0 --- diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 17e0ceddf..7c85821a1 100644 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -132,7 +132,7 @@ static bool isShapeInTree(const TDF_Label& theAccess1, const TDF_Label& theAcces if (aResult) { //check evolution and a label of this shape for(TNaming_SameShapeIterator aShapes(theShape, theAccess1); aShapes.More(); aShapes.Next()) { - static Handle(TNaming_NamedShape) aNS; + Handle(TNaming_NamedShape) aNS; if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) { if (aNS->Evolution() != TNaming_SELECTED) { theOriginalLabel = aNS->Label(); diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 5b68969e8..8fec2926d 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -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); diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index 217e77eeb..5cda6ef82 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -325,6 +325,9 @@ class Model_Document : public ModelAPI_Document MODEL_EXPORT virtual std::shared_ptr nextFeature( std::shared_ptr theCurrent, const bool theReverse = false) const; + //! Erases the document structure. + ~Model_Document(); + protected: //! Returns (creates if needed) the general label TDF_Label generalLabel() const; diff --git a/src/Model/Model_Objects.h b/src/Model/Model_Objects.h index 3ae6c713a..09b0e2081 100644 --- a/src/Model/Model_Objects.h +++ b/src/Model/Model_Objects.h @@ -27,7 +27,6 @@ #include #include -#include #include #include #include