From: mpv Date: Mon, 26 Jan 2015 12:28:44 +0000 (+0300) Subject: Fix for issue #362 : something wrong with references during the close action X-Git-Tag: V_1.0.0~19^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cf2410015412c3c73a28897f0dd7fb0d4e1a909d;p=modules%2Fshaper.git Fix for issue #362 : something wrong with references during the close action --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 3efd64be7..680b7fd3e 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -250,8 +250,7 @@ void Model_Document::close(const bool theForever) subDoc(*aSubIter)->close(theForever); // close for thid document needs no transaction in this document - if (this == aPM->moduleDocument().get()) - std::static_pointer_cast(Model_Session::get())->setCheckTransactions(false); + std::static_pointer_cast(Model_Session::get())->setCheckTransactions(false); // delete all features of this document std::shared_ptr aThis = @@ -282,8 +281,7 @@ void Model_Document::close(const bool theForever) myDoc->Close(); } - if (this == aPM->moduleDocument().get()) - std::static_pointer_cast(Model_Session::get())->setCheckTransactions(true); + std::static_pointer_cast(Model_Session::get())->setCheckTransactions(true); } void Model_Document::startOperation() diff --git a/src/SketchSolver/SketchSolver_Constraint.cpp b/src/SketchSolver/SketchSolver_Constraint.cpp index 88f4572a1..61a42b64c 100644 --- a/src/SketchSolver/SketchSolver_Constraint.cpp +++ b/src/SketchSolver/SketchSolver_Constraint.cpp @@ -229,11 +229,13 @@ AttrType typeOfAttribute(std::shared_ptr theAttribute) return ARC; } } else { - const std::string aType = anAttrRef->attr()->attributeType(); - if (aType == GeomDataAPI_Point2D::type()) - return POINT2D; - if (aType == GeomDataAPI_Point2D::type()) - return POINT2D; + if (anAttrRef->attr().get() != NULL) { + const std::string aType = anAttrRef->attr()->attributeType(); + if (aType == GeomDataAPI_Point2D::type()) + return POINT2D; + if (aType == GeomDataAPI_Point2D::type()) + return POINT2D; + } } return UNKNOWN;