]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Small fixed. Add check for unregister object.
authorimn <imn@opencascade.com>
Mon, 14 Nov 2016 11:23:24 +0000 (14:23 +0300)
committerimn <imn@opencascade.com>
Mon, 14 Nov 2016 11:23:24 +0000 (14:23 +0300)
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_SWIG/geomBuilder.py

index b01845065d869e09f80740aee624c4948a6d8c48..b608b185f39f2829538afee2a1fdd7e274eb2b26 100644 (file)
@@ -1093,8 +1093,8 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(GEOM::GEOM_Object_ptr   theObject,
       if (aList[0]->GetMarkerType() == GEOM::MT_USER)
         theObject->SetMarkerTexture(aList[0]->GetMarkerTexture());
     }
-
-    anArgSO->UnRegister();
+    if (!CORBA::is_nil(anArgSO))
+      anArgSO->UnRegister();
   }
   else {
     // Get interface, containing method, which we will use to reconstruct sub-shapes
@@ -1322,7 +1322,8 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(GEOM::GEOM_Object_ptr   theObject,
             }
           }
         } // try to build from published parts
-        anArgSO->UnRegister();
+       if (!CORBA::is_nil(anArgSO))
+          anArgSO->UnRegister();
       }
     } // process arguments
   }
index 25e87c8fda7b7b46bca107b123ed1d30419e59bc..497ba0b55c5a7d34db5b43f2ff82b4b6a4ea57ec 100644 (file)
@@ -924,7 +924,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             """
             # Example: see GEOM_TestAll.py
             try:
-                aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
+                aSObject = self.AddInStudy(aShape, aName, aFather)
                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
             except:
                 print "addToStudyInFather() failed"