]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/Builtins.java
Builtins and JavaModule SCL modules may leak memory
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / java / Builtins.java
index 334cb4560cc488e2ae2a9101dc245f64c0f10c04..4d48d1e9cb1442ec5854728b2b83518e985b859b 100644 (file)
@@ -9,7 +9,6 @@ import org.simantics.scl.compiler.common.precedence.Associativity;
 import org.simantics.scl.compiler.common.precedence.Precedence;
 import org.simantics.scl.compiler.constants.BooleanConstant;
 import org.simantics.scl.compiler.constants.Constant;
-import org.simantics.scl.compiler.constants.JavaConstructor;
 import org.simantics.scl.compiler.constants.JavaStaticField;
 import org.simantics.scl.compiler.constants.JavaStaticMethod;
 import org.simantics.scl.compiler.constants.NoRepConstant;
@@ -53,10 +52,10 @@ import org.simantics.scl.runtime.profiling.BranchPoint;
 
 public class Builtins extends ConcreteModule {
 
-    public static SCLValue[] TUPLE_CONSTRUCTORS = new SCLValue[Constants.MAX_TUPLE_LENGTH+1];
-    public static SCLValue[] LIST_CONSTRUCTORS = new SCLValue[Constants.MAX_LIST_LITERAL_LENGTH+1];
+    public static final SCLValue[] TUPLE_CONSTRUCTORS = new SCLValue[Constants.MAX_TUPLE_LENGTH+1];
+    public static final SCLValue[] LIST_CONSTRUCTORS = new SCLValue[Constants.MAX_LIST_LITERAL_LENGTH+1];
     
-    public static final Builtins INSTANCE = new Builtins();       
+    public static Builtins INSTANCE = new Builtins();
     
     public static SCLValue Nothing;
     public static SCLValue Just;
@@ -363,4 +362,8 @@ public class Builtins extends ConcreteModule {
         return documentation;
     }
 
+       public static void flush() {
+               INSTANCE = new Builtins();
+       }
+
 }