Do not dispose classLoader so that dependent types can be loaded on demand, like closures.

This commit is contained in:
Ilya Ryzhenkov
2014-03-17 23:21:13 +04:00
committed by Andrey Breslav
parent e49f4a0722
commit d08f2bc7ab
@@ -226,7 +226,7 @@ public class KotlinToJVMBytecodeCompiler {
return null; return null;
} }
GeneratedClassLoader classLoader = null; GeneratedClassLoader classLoader;
try { try {
classLoader = new GeneratedClassLoader(state.getFactory(), classLoader = new GeneratedClassLoader(state.getFactory(),
new URLClassLoader(new URL[] { new URLClassLoader(new URL[] {
@@ -240,12 +240,6 @@ public class KotlinToJVMBytecodeCompiler {
catch (Exception e) { catch (Exception e) {
throw new RuntimeException("Failed to evaluate script: " + e, e); throw new RuntimeException("Failed to evaluate script: " + e, e);
} }
finally {
if (classLoader != null) {
classLoader.dispose();
}
state.destroy();
}
} }
@Nullable @Nullable