]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for issue #362 : something wrong with references during the close action
authormpv <mpv@opencascade.com>
Mon, 26 Jan 2015 12:28:44 +0000 (15:28 +0300)
committermpv <mpv@opencascade.com>
Mon, 26 Jan 2015 12:28:44 +0000 (15:28 +0300)
src/Model/Model_Document.cpp
src/SketchSolver/SketchSolver_Constraint.cpp

index 3efd64be7ee7be75491a628bf3790a68150f4d59..680b7fd3ed6354db2a17bb0ae5a97d30213f1648 100644 (file)
@@ -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>(Model_Session::get())->setCheckTransactions(false);
+  std::static_pointer_cast<Model_Session>(Model_Session::get())->setCheckTransactions(false);
 
   // delete all features of this document
   std::shared_ptr<ModelAPI_Document> 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>(Model_Session::get())->setCheckTransactions(true);
+  std::static_pointer_cast<Model_Session>(Model_Session::get())->setCheckTransactions(true);
 }
 
 void Model_Document::startOperation()
index 88f4572a17c05d7e8b20e352b0524cf32045a075..61a42b64cf43195b46d9b6bb549cffc78040aa83 100644 (file)
@@ -229,11 +229,13 @@ AttrType typeOfAttribute(std::shared_ptr<ModelAPI_Attribute> 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;