Closed jameshball closed 2 years ago
Hi!
Initially, it was not planned that the window would be closed and then openned. So the "lifecycle" of the Node was based on that. I removed it in the last commit and will release a new version later.
DirectDrawPolicy.IF_AVAILABLE
to DirectDrawPolicy.NEVER
. Direct mode is not very stableThanks so much for the quick response and code suggestions!!
First of all, thanks for making this library as I believe it's the only way I can get JavaFX working at all with LWJGL on mac.
Unfortunately, I'm running into a few stability issues, particularly around disposing of the OpenGLCanvas.
When I start the program I have two windows
If I close (using the X on Windows) the Stage associated with the OpenGLCanvas window, it works fine, but when I reopen it with a button from the other window (which calls
Stage.show()
) and then close it again it consistently causes a JVM native crash.I am assuming this is because I am somehow closing some LWJGL resource twice. Below is an example error log generated after the crash that shows it's an issue with
GLFW.glfwDestroyWindow()
:hs_err_pid4056.log
An alternative method I've tried which doesn't crash is to call
close()
on the Stage associated with the OpenGLCanvas window and completely re-initialise the Stage and OpenGLCanvas whenever I want to reopen the window. The problem with this method is that no resources are freed, which I can verify by repeatedly opening and closing the window and seeing the performance get worse and worse.Snippet of the second method below:
The
launch(args)
callsstartOscilloscope()
after initialisation of the main JavaFX Stage.Oscilloscope class referenced in above code:
Let me know if there's any other info you need!