From ddcfb2759e35b1e5c4e0eb97ccda125d8c4c660e Mon Sep 17 00:00:00 2001 From: caremoli Date: Fri, 18 Sep 2009 15:18:51 +0000 Subject: [PATCH] CCAR: add a check to see if the CORBA object exists (non_existent()) --- src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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()))) { -- 2.39.2