Fix a memory leak in the variable browser 17/11317/3
Sylvestre Ledru [Thu, 18 Apr 2013 09:15:21 +0000 (11:15 +0200)]
Change-Id: If8e9d33512220ad83efd8775261aa953a2d3ad4b

scilab/modules/ui_data/src/cpp/UpdateBrowseVar.cpp

index ea117df..256ed89 100644 (file)
@@ -195,6 +195,7 @@ void UpdateBrowseVar(BOOL update)
 
     freeArrayOfString(pstAllVariableNames, iLocalVariablesUsed + iGlobalVariablesUsed);
     freeArrayOfString(pstAllVariableVisibility, iLocalVariablesUsed + iGlobalVariablesUsed);
+    freeArrayOfString(pstAllVariableSizes, iLocalVariablesUsed + iGlobalVariablesUsed);
 
     if (piAllVariableFromUser)
     {
@@ -220,11 +221,6 @@ void UpdateBrowseVar(BOOL update)
         piAllVariableIntegerTypes = NULL;
     }
 
-    if (pstAllVariableSizes)
-    {
-        FREE(pstAllVariableSizes);
-        pstAllVariableSizes = NULL;
-    }
 }
 
 /*--------------------------------------------------------------------------*/