modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java

Print this page

        

*** 335,346 **** timerRunnable = () -> { try { QuantumToolkit.this.postPulse(); } catch (Throwable th) { th.printStackTrace(System.err); - // } catch (RuntimeException re) { - // ignore spurious Glass timer events while exiting... } }; pulseTimer = Application.GetApplication().createTimer(timerRunnable); Application.GetApplication().setEventHandler(new Application.EventHandler() { --- 335,344 ----
*** 748,757 **** --- 746,758 ---- @Override public void exit() { // This method must run on the FX application thread checkFxUserThread(); + // Turn off pulses so no extraneous runnables are submitted + pulseTimer.stop(); + // We need to wait for the last frame to finish so that the renderer // is not running while we are shutting down glass. PaintCollector.getInstance().waitForRenderingToComplete(); notifyShutdownHooks();
*** 769,779 **** super.exit(); } public void dispose() { if (toolkitRunning.compareAndSet(true, false)) { - pulseTimer.stop(); renderer.stopRenderer(); try { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { Runtime.getRuntime().removeShutdownHook(shutdownHook); --- 770,779 ----