commit 646f16a4a9bced32ccb1e5f7509883cc6428d8b6
parent 8b073e87765bb0dcee183bb22e3bfe6b42668e16
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Tue, 23 Aug 2016 13:41:28 +0200
ssol_scene_clear now detaches attached sun (if any)
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/ssol.h b/src/ssol.h
@@ -288,7 +288,8 @@ ssol_scene_detach_object_instance
struct ssol_object_instance* instance);
/* Detach all the instances from the scene and release the reference that the
- * scene takes onto them. */
+ * scene takes onto them.
+ * Also detach the attached sun if any. */
SSOL_API res_T
ssol_scene_clear
(struct ssol_scene* scn);
diff --git a/src/ssol_scene.c b/src/ssol_scene.c
@@ -201,6 +201,8 @@ ssol_scene_clear(struct ssol_scene* scene)
}
htable_instance_clear(&scene->instances);
S3D(scene_clear(scene->s3d_scn));
+ if(scene->sun)
+ ssol_scene_detach_sun(scene, scene->sun);
return RES_OK;
}