summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-04-25 18:25:11 -0400
committerDavid Thompson <dthompson2@worcester.edu>2017-04-25 20:36:46 -0400
commit4ea65a486a6753641dee5f42f14abcaa398e8907 (patch)
tree9cd2ae8e1f7ff16da7af8423ee3731219c5382c8
parent78a0e2a289a076814cb404190a3ae6556b9f5a1a (diff)
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.
-rw-r--r--chickadee.scm4
1 files changed, 2 insertions, 2 deletions
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)