From 33f28fa4decefcf9c4fb2315f516947797fe1a86 Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 5 Jun 2007 12:51:19 +0000 Subject: [PATCH] NPAL16136: Error FindObjectIOR after RemoveObjectWithChildren: removed object found. --- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; } -- 2.39.2