Fixes #1249 - Don't hang up when destroy is called multiple times (#1250)

This commit is contained in:
MeFisto94 2020-01-27 09:03:25 +01:00 committed by Stephen Gold
parent 233bc6f0da
commit 124ad35677

View File

@ -266,7 +266,11 @@ public abstract class LwjglAbstractDisplay extends LwjglContext implements Runna
this.autoFlush = enabled; this.autoFlush = enabled;
} }
public void destroy(boolean waitFor){ public void destroy(boolean waitFor) {
if (needClose.get()) {
return; // Already destroyed
}
needClose.set(true); needClose.set(true);
if (waitFor) if (waitFor)
waitFor(false); waitFor(false);