]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
21948: EDF SMESH : Memory is not freed when deleting a mesh
authoreap <eap@opencascade.com>
Fri, 14 Dec 2012 10:37:47 +0000 (10:37 +0000)
committereap <eap@opencascade.com>
Fri, 14 Dec 2012 10:37:47 +0000 (10:37 +0000)
-      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());

src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx

index 32ac92b58728184603c88642cac9b7738f07699d..fc7d67fdd1ad3ba2671f1ac05ec694208ec3cbe4 100644 (file)
@@ -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);
   }
 }
-