Skip to content

Commit 2666127

Browse files
committed
Attempt to solve a memory leak by releasing JIProlog resources.
1 parent 594e437 commit 2666127

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ minecraft_version = 1.12.2
33
forge_version = 14.23.5.2847
44

55
mod_name = OpenProlog
6-
mod_version=0.3.1
6+
mod_version=0.3.2
77
opencomputers_version=1.7.5.192
88

99
org.gradle.jvmargs = -Xmx2048m

src/main/java/com/syntheticentropy/ocpro/OpenProlog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class OpenProlog
2020
@SuppressWarnings("WeakerAccess")
2121
public static final String NAME = "OpenProlog";
2222
@SuppressWarnings("WeakerAccess")
23-
public static final String VERSION = "1.0";
23+
public static final String VERSION = "0.3.2";
2424

2525
// resource path
2626
static final String RESOURCE_PATH = "/com/syntheticentropy/ocpro/";

src/main/java/com/syntheticentropy/ocpro/PrologVM.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public void run() {
3535
state = State.Terminated;
3636
exitException = e;
3737
owner.crash(e.getMessage());
38+
} finally {
39+
if (jip != null) {
40+
jip.releaseAllResources();
41+
jip = null;
42+
}
3843
}
3944
}
4045

0 commit comments

Comments
 (0)