]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java
Added memory leak test and fixed the leak by removing references
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / codegen / ssa / statements / LetApply.java
index 6d139a4d6fda4f1927ac84b9a99f550456503d49..d9d79737f5222ab39e475a6385377eef49f8f0ce 100644 (file)
@@ -399,7 +399,7 @@ public class LetApply extends LetStatement implements ValRefBinder {
         tailBlock.setExit(headBlock.getExit());
         
         // Merge blocks        
-        thisFunction.mergeBlocks(function);           
+        thisFunction.mergeBlocks(function);
         
         headBlock.setExit(new Jump(function.getFirstBlock().createOccurrence(), 
                 parameters));
@@ -488,4 +488,11 @@ public class LetApply extends LetStatement implements ValRefBinder {
         for(ValRef parameter : parameters)
             visitor.visit(parameter);
     }
+
+    @Override
+    public void cleanup() {
+        function.remove();
+        for(ValRef parameter : parameters)
+            parameter.remove();
+    }
 }