From 4ea65a486a6753641dee5f42f14abcaa398e8907 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 25 Apr 2017 18:25:11 -0400 Subject: Fix unbounded heap growth in game loop. * chickadee.scm (run-game): Make sure that the recursive calls to the update loop are in tail position. --- chickadee.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'chickadee.scm') diff --git a/chickadee.scm b/chickadee.scm index 10136d9..d65a265 100644 --- a/chickadee.scm +++ b/chickadee.scm @@ -173,9 +173,9 @@ (loop (poll-event)))) ;; Advance the simulation. (run-hook update-hook update-interval) - (update-loop (- lag update-interval)) ;; Free any GPU resources that have been GC'd. - (gpu-reap!)) + (gpu-reap!) + (update-loop (- lag update-interval))) (begin ;; Render a frame. (run-hook before-draw-hook) -- cgit v1.2.3