Fix T51998: Anim player uses 100% CPU
authorCampbell Barton <ideasman42@gmail.com>
Mon, 10 Jul 2017 07:37:00 +0000 (17:37 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 10 Jul 2017 07:37:00 +0000 (17:37 +1000)
The loop running with no events didn't sleep.
Now wait for events when paused.

source/blender/windowmanager/intern/wm_playanim.c

index 0a6e329a7c10c9d2f8e73234ebf2562785874be7..e68f3364b116c625f32bcadf2e48755582219267 100644 (file)
@@ -1428,8 +1428,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
 
                        ps.next_frame = ps.direction;
 
-
-                       while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0)) || ps.wait2) {
+                       while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, ps.wait2d))) {
                                if (hasevent) {
                                        GHOST_DispatchEvents(g_WS.ghost_system);
                                }