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

Print this page

        

@@ -314,11 +314,11 @@
              *  Glass Application instance is now valid - create the ResourceFactory
              *  on the render thread
              */
             renderer.createResourceFactory();
 
-            pulseRunnable = () -> QuantumToolkit.this.pulse();
+            pulseRunnable = () -> QuantumToolkit.this.pulseFromQueue();
             timerRunnable = () -> {
                 try {
                     QuantumToolkit.this.postPulse();
                 } catch (Throwable th) {
                     th.printStackTrace(System.err);

@@ -484,10 +484,18 @@
         if (debug) {
             System.err.println("QT.endPulse: " + System.nanoTime());
         }
     }
 
+    void pulseFromQueue() {
+        try {
+            pulse();
+        } finally {
+            endPulseRunning();
+        }
+    }
+
     protected void pulse() {
         pulse(true);
     }
 
     void pulse(boolean collect) {

@@ -509,11 +517,10 @@
             }
             firePulse();
             if (collect) collector.renderAll();
         } finally {
             inPulse--;
-            endPulseRunning();
             if (PULSE_LOGGING_ENABLED) {
                 PulseLogger.pulseEnd();
             }
         }
     }