diff options
Diffstat (limited to 'libdimension/texture.c')
-rw-r--r-- | libdimension/texture.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libdimension/texture.c b/libdimension/texture.c index a5ebd90..3867628 100644 --- a/libdimension/texture.c +++ b/libdimension/texture.c @@ -32,11 +32,16 @@ dmnsn_new_pigment() return pigment; } -/* Free a dummy pigment */ +/* Free a pigment */ void dmnsn_delete_pigment(dmnsn_pigment *pigment) { - free(pigment); + if (pigment) { + if (pigment->free_fn) { + (*pigment->free_fn)(pigment->ptr); + } + free(pigment); + } } /* Allocate a dummy texture */ |