memleak fixed in SeqExp about ifstream 52/17652/3
Cedric Delamarre [Thu, 7 Jan 2016 16:53:52 +0000 (17:53 +0100)]
test_run("ast",[],"mode_nwni_profiling")

Change-Id: I34634f3632e31b76e3d586ba8461a880a3ec866e

scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp

index 0b73354..3f67eb4 100644 (file)
@@ -255,9 +255,23 @@ void RunVisitorT<T>::visitprivate(const SeqExp  &e)
         {
             ConfigVariable::fillWhereError(ie.GetErrorLocation().first_line);
             CoverageInstance::stopChrono((void*)&e);
+            if (file)
+            {
+                file->close();
+                delete file;
+            }
+
             throw ie;
         }
-
+        catch (const InternalAbort& ia)
+        {
+            if (file)
+            {
+                file->close();
+                delete file;
+            }
+            throw ia;
+        }
         // If something other than NULL is given to setResult, then that would imply
         // to make a cleanup in visit(ForExp) for example (e.getBody().accept(*this);)
         setResult(NULL);