diff options
Diffstat (limited to 'libdimension/timer.c')
-rw-r--r-- | libdimension/timer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libdimension/timer.c b/libdimension/timer.c index 0e120ce..ad0fd9b 100644 --- a/libdimension/timer.c +++ b/libdimension/timer.c @@ -30,6 +30,7 @@ dmnsn_new_timer(void) { dmnsn_timer *timer = dmnsn_malloc(sizeof(dmnsn_timer)); dmnsn_get_times(timer); + timer->refcount = 1; return timer; } @@ -46,5 +47,7 @@ dmnsn_complete_timer(dmnsn_timer *timer) void dmnsn_delete_timer(dmnsn_timer *timer) { - dmnsn_free(timer); + if (DMNSN_DECREF(timer)) { + dmnsn_free(timer); + } } |