From: caremoli Date: Fri, 18 Sep 2009 15:18:51 +0000 (+0000) Subject: CCAR: add a check to see if the CORBA object exists (non_existent()) X-Git-Tag: V5_1_3rc1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ddcfb2759e35b1e5c4e0eb97ccda125d8c4c660e;p=modules%2Fkernel.git CCAR: add a check to see if the CORBA object exists (non_existent()) --- diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx index 3ce911286..ad85e1f2e 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx @@ -46,12 +46,13 @@ void IORGenericObjDecref(const std::string& anIOR) SALOME::GenericObj_var gobj; try { - obj = getORB()->string_to_object(anIOR.c_str()); - gobj = SALOME::GenericObj::_narrow(obj); - if(! CORBA::is_nil(gobj) ) - { - gobj->Destroy(); - } + obj = getORB()->string_to_object(anIOR.c_str()); + if(obj->_non_existent())return; + gobj = SALOME::GenericObj::_narrow(obj); + if(! CORBA::is_nil(gobj) ) + { + gobj->Destroy(); + } } catch(const CORBA::Exception& e) { @@ -65,6 +66,7 @@ void IORGenericObjIncref(const std::string& anIOR) try { obj = getORB()->string_to_object(anIOR.c_str()); + if(obj->_non_existent())return; gobj = SALOME::GenericObj::_narrow(obj); if(! CORBA::is_nil(gobj) ) { @@ -96,7 +98,7 @@ const std::string& SALOMEDSImpl_AttributeIOR::GetID () //======================================================================= SALOMEDSImpl_AttributeIOR* SALOMEDSImpl_AttributeIOR::Set (const DF_Label& L, - const std::string& S) + const std::string& S) { SALOMEDSImpl_AttributeIOR* A = NULL; if (!(A=(SALOMEDSImpl_AttributeIOR*)L.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {