From b531199eb551e35df458edb600c535e51b84e8aa Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Fri, 20 Jan 2017 12:49:23 +0100 Subject: [PATCH] Allow JAVA2D to terminate when animation thread dies When Java2D sketch crashes, closing the window does not stop Event Dispatch Thread. This fix makes PApplet.exit() do the right thing and not wait for surface to finish when the thread is already dead. Fixes #4831 --- core/src/processing/core/PSurfaceNone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/processing/core/PSurfaceNone.java b/core/src/processing/core/PSurfaceNone.java index 7b5a17f57..cb9038459 100644 --- a/core/src/processing/core/PSurfaceNone.java +++ b/core/src/processing/core/PSurfaceNone.java @@ -207,7 +207,7 @@ public class PSurfaceNone implements PSurface { public boolean isStopped() { - return thread == null; + return thread == null || !thread.isAlive(); }