Memory leak fixed in types 18/19218/2
Cedric Delamarre [Wed, 22 Mar 2017 10:34:48 +0000 (11:34 +0100)]
    * test_run ast bug_15008 mode_nwni_profiling

Change-Id: I6d0e6b88f811a47a7517e0b7efb871260c6543f8

scilab/modules/ast/includes/types/arrayof.hxx

index 2e578e7..fe16ef8 100644 (file)
@@ -219,21 +219,24 @@ public :
     virtual void fillDefaultValues()
     {
         int size = getSize();
+        T tNullVal = getNullValue();
         if (isComplex())
         {
             for (int i = 0; i < size; ++i)
             {
-                set(i, getNullValue());
-                setImg(i, getNullValue());
+                set(i, tNullVal);
+                setImg(i, tNullVal);
             }
         }
         else
         {
             for (int i = 0; i < size; ++i)
             {
-                set(i, getNullValue());
+                set(i, tNullVal);
             }
         }
+
+        deleteData(tNullVal);
     }
 
     virtual ArrayOf<T>* setComplex(bool _bComplex)