From: jfa Date: Tue, 5 Jun 2007 12:51:19 +0000 (+0000) Subject: NPAL16136: Error FindObjectIOR after RemoveObjectWithChildren: removed object found. X-Git-Tag: T15881~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=33f28fa4decefcf9c4fb2315f516947797fe1a86;p=modules%2Fkernel.git NPAL16136: Error FindObjectIOR after RemoveObjectWithChildren: removed object found. --- diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index e34aa990a..43a59f7ac 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -343,17 +343,19 @@ Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_Study::FindObjectByName(const Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_Study::FindObjectIOR(const TCollection_AsciiString& anObjectIOR) { _errorCode = ""; - + Handle(SALOMEDSImpl_SObject) aResult = NULL; - + // searching in the datamap for optimization if (myIORLabels.IsBound(anObjectIOR)) { aResult = GetSObject(myIORLabels.Find(anObjectIOR)); // 11 oct 2002: forbidden attributes must be checked here - if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) + if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) { myIORLabels.UnBind(anObjectIOR); + aResult = NULL; + } } - + if(aResult.IsNull()) _errorCode = "No object was found"; return aResult; }