fix bug on cell extraction 85/16485/1
Antoine ELIAS [Tue, 19 May 2015 11:56:43 +0000 (13:56 +0200)]
Change-Id: I2b5b98181d772043ef5309178809eefd6bc2b5ad

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

index 1708b62..4592940 100644 (file)
@@ -349,14 +349,18 @@ void RunVisitorT<T>::visitprivate(const CellCallExp &e)
 
             if (pList->getSize() == 1)
             {
-                setResult(pList->get(0));
+                InternalType* ret = pList->get(0);
+                setResult(ret);
+
+                ret->IncreaseRef();
+                pList->killMe();
+                ret->DecreaseRef();
             }
             else
             {
                 setResult(pList);
             }
 
-            pList->killMe();
 
             //clean pArgs return by GetArgumentList
             for (int iArg = 0 ; iArg < (int)pArgs->size() ; iArg++)