Don't crash render thread even if there is no world

This commit is contained in:
Renaud Casenave-Péré 2015-08-27 18:39:23 +02:00
parent a2b107f53f
commit 03b2fa65fb

View file

@ -67,9 +67,11 @@ Destroy the opengl context and the related resources."
do (render-scene-node child scene)))
(defun render-world (world)
(with-lock-held ((scene-lock world))
(with-accessors ((scene world-scene)) world
(render-scene-node (root-node scene) scene))))
(unless (null world)
(with-lock-held ((scene-lock world))
(with-accessors ((scene world-scene)) world
(unless (null scene)
(render-scene-node (root-node scene) scene))))))
(defmethod thread-initialize ((thread render-thread))
(format t "Initialize ~a~%" (name thread))