diff options
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); } |