diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-05-21 20:27:09 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-05-21 20:27:09 -0600 |
commit | 0f0b704144bddc045657f7ed852b49d5e349b0bd (patch) | |
tree | cefc022b10cc4f5675245ea2e77c24c89a6bc30a /libdimension/camera.c | |
parent | 07d784563af19c162945c60562819269e6fc4994 (diff) | |
download | dimension-0f0b704144bddc045657f7ed852b49d5e349b0bd.tar.xz |
Add refcounts to cameras.
Diffstat (limited to 'libdimension/camera.c')
-rw-r--r-- | libdimension/camera.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libdimension/camera.c b/libdimension/camera.c index 67117f9..e76200a 100644 --- a/libdimension/camera.c +++ b/libdimension/camera.c @@ -31,8 +31,9 @@ dmnsn_camera * dmnsn_new_camera(void) { dmnsn_camera *camera = dmnsn_malloc(sizeof(dmnsn_camera)); - camera->free_fn = NULL; - camera->trans = dmnsn_identity_matrix(); + camera->free_fn = NULL; + camera->trans = dmnsn_identity_matrix(); + camera->refcount = dmnsn_new_refcount(); return camera; } @@ -40,7 +41,8 @@ dmnsn_new_camera(void) void dmnsn_delete_camera(dmnsn_camera *camera) { - if (camera) { + if (camera && DMNSN_DECREF(camera)) { + dmnsn_delete_refcount(camera->refcount); if (camera->free_fn) { camera->free_fn(camera->ptr); } |