From 3acd1704473c2f57432b20228e8baf4ced8c53f3 Mon Sep 17 00:00:00 2001 From: imn Date: Mon, 14 Nov 2016 14:23:24 +0300 Subject: [PATCH] Small fixed. Add check for unregister object. --- src/GEOM_I/GEOM_Gen_i.cc | 7 ++++--- src/GEOM_SWIG/geomBuilder.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index b01845065..b608b185f 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -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 } diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 25e87c8fd..497ba0b55 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -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" -- 2.39.2