diff options
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/object.c | 1 | ||||
-rw-r--r-- | libdimension/texture.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libdimension/object.c b/libdimension/object.c index f10d53d..18d7adb 100644 --- a/libdimension/object.c +++ b/libdimension/object.c @@ -57,6 +57,7 @@ void dmnsn_delete_object(dmnsn_object *object) { if (object) { + dmnsn_delete_texture(object->texture); if (object->free_fn) { (*object->free_fn)(object->ptr); } diff --git a/libdimension/texture.c b/libdimension/texture.c index f232cbc..a5ebd90 100644 --- a/libdimension/texture.c +++ b/libdimension/texture.c @@ -54,5 +54,8 @@ dmnsn_new_texture() void dmnsn_delete_texture(dmnsn_texture *texture) { - free(texture); + if (texture) { + dmnsn_delete_pigment(texture->pigment); + free(texture); + } } |