Xcos: fix Ball on a platform demo
[scilab.git] / scilab / modules / scicos / src / cpp / sciblk4.cpp
index 45109a2..94549f6 100644 (file)
@@ -263,19 +263,16 @@ void sciblk4(scicos_block* blk, const int flag)
         *blk->work = pIT;
         pIT->IncreaseRef();
     }
-    else
-    {
-        pIT = *(types::InternalType**) blk->work;
-    }
-
-    if (flag == 5) // Ending
+    else if (flag == 5) // Ending
     {
+        pIT = *(types::InternalType**)blk->work;
         pIT->DecreaseRef();
     }
     else // any other flag might use refreshed values
     {
+        pIT = *(types::InternalType**)blk->work;
         pIT = refreshblklist(pIT, blk, -1, funtyp[kfun - 1]);
-    }
+       }
 
     in.push_back(pIT);
     /* * flag * */