Skip to content

Commit 124ad35

Browse files
MeFisto94stephengold
authored andcommitted
Fixes jMonkeyEngine#1249 - Don't hang up when destroy is called multiple times (jMonkeyEngine#1250)
1 parent 233bc6f commit 124ad35

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ public void setAutoFlushFrames(boolean enabled){
266266
this.autoFlush = enabled;
267267
}
268268

269-
public void destroy(boolean waitFor){
269+
public void destroy(boolean waitFor) {
270+
if (needClose.get()) {
271+
return; // Already destroyed
272+
}
273+
270274
needClose.set(true);
271275
if (waitFor)
272276
waitFor(false);

0 commit comments

Comments
 (0)