From 124ad35677ebe4c3bd55ce938ef3633704e9adce Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Mon, 27 Jan 2020 09:03:25 +0100 Subject: [PATCH] Fixes #1249 - Don't hang up when destroy is called multiple times (#1250) --- .../java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java index 528c788ea..e2be6a78d 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java @@ -266,7 +266,11 @@ public abstract class LwjglAbstractDisplay extends LwjglContext implements Runna this.autoFlush = enabled; } - public void destroy(boolean waitFor){ + public void destroy(boolean waitFor) { + if (needClose.get()) { + return; // Already destroyed + } + needClose.set(true); if (waitFor) waitFor(false);