From: eap Date: Fri, 14 Dec 2012 10:37:47 +0000 (+0000) Subject: 21948: EDF SMESH : Memory is not freed when deleting a mesh X-Git-Tag: B4NGCMakeInt~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f7d7e0eacca35b3168f0c8c970d9cc96e0e1577f;p=modules%2Fkernel.git 21948: EDF SMESH : Memory is not freed when deleting a mesh - SALOMEDSImpl_AttributeIOR::Set (current, ior_string); + SALOMEDSImpl_AttributeIOR* iorAttr = SALOMEDSImpl_AttributeIOR::Set (current, ior_string); + // make myRefCounter of a loaded GenericObj == 1 + SALOMEDSImpl_Study::UnRegisterGenObj( ior_string, iorAttr->Label()); --- diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index 32ac92b58..fc7d67fdd 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -409,7 +409,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, if (aLocked) _study->GetProperties()->SetLocked(true); if (!hasModuleData) - return true; + return true; _errorCode = "No persistent file"; return false; @@ -1008,13 +1008,14 @@ static void Translate_persistentID_to_IOR(DF_Label& Lab, SALOMEDSImpl_Driver* dr std::string persist_ref = Att->Value(); SALOMEDSImpl_SObject so = SALOMEDSImpl_Study::SObject(current); std::string ior_string = driver->LocalPersistentIDToIOR(so, - persist_ref, - isMultiFile, - isASCII); - SALOMEDSImpl_AttributeIOR::Set (current, ior_string); - + persist_ref, + isMultiFile, + isASCII); + SALOMEDSImpl_AttributeIOR* iorAttr = SALOMEDSImpl_AttributeIOR::Set (current, ior_string); + + // make myRefCounter of a loaded GenericObj == 1 + SALOMEDSImpl_Study::UnRegisterGenObj( ior_string, iorAttr->Label()); } Translate_persistentID_to_IOR (current, driver, isMultiFile, isASCII); } } -