Open rhpenguins opened 5 years ago
I also got this error on macOS Sierra (10.12.6)
stop
On Wed, Dec 12, 2018 at 6:00 PM Jeremy Douglass notifications@github.com wrote:
I also got this error on macOS Sierra (10.12.6)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/processing/processing/issues/5722#issuecomment-446776761, or mute the thread https://github.com/notifications/unsubscribe-auth/AIX89RbTFq2GjI1So5TRhXs0EVyzNvlXks5u4YqOgaJpZM4ZQkNG .
I am using Windows 10 and (when using the FX2D renderer) when exiting the program, a Java Process still remains in the Process Explorer. This does not happen when using the Default renderer (Java2D)
I am using Processing 3.5.3 and G4P 4.2.1
I've come across these issues in a JavaFX application I wrote a while back. While I don't have a permanent fix, here are the workarounds I came up with back then. There are two issues; one affecting only Mac OS and the other only Windows:
MacOS Issue (@rhpenguins, @jeremydouglass) Application doesn't close when the exit()
method is called. I found the issue could be fixed by explicitly defining an exit()
function which calls the exitActual()
method (I've tested this in Processing v3.5.4 but not v4.0b7 yet):
public void exit() {
exitActual();
}
Windows Issue (@berserkingyadis) Any additional threads are not closed when pressing the "X" window close button, and remain as background processes. In Bers' case these threads were probably created by the G4P library. This can be solved by registering a "dispose handler" which calls the exit()
function when the window close button is pressed (I've tested this in both Processing v3.5.4 and v4.0b7):
DisposeHandler dh;
void setup() { size(400, 300, FX2D); dh = new DisposeHandler(this); thread("backgroundThread"); }
public class DisposeHandler {
DisposeHandler(PApplet pa) {
pa.registerMethod("dispose", this);
}
public void dispose() { exit(); } }
// Example infinite background thread void backgroundThread() { while (true) { delay(1000); } }
- Both of these fixes can be used together to make the sketch work on both platforms, and I haven't come across any side-effects yet...
Calling exit() using FX2D renderer doesn’t stop the program.
Expected Behavior
When exit() is called in the program the Java app doesn't properly shut down, and throws an error: Not on FX application thread; currentThread = JavaFX Application Thread. The only way to fully exit the sketch is to stop it from within the IDE.
It seems that this only affects Mac users.
Current Behavior
Steps to Reproduce
Your Environment
Possible Causes / Solutions