libanim

changeset 65:817a5c3a7f96

fixed a crashing bug in anm_destroy_node introduced when I added the multiple animations per node
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 23 Jan 2014 02:53:09 +0200
parents eb024fa08fe6
children 29c6c8ff99d9
files src/anim.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/src/anim.c	Mon Dec 30 15:22:44 2013 +0200
     1.2 +++ b/src/anim.c	Thu Jan 23 02:53:09 2014 +0200
     1.3 @@ -75,10 +75,11 @@
     1.4  
     1.5  void anm_destroy_node(struct anm_node *node)
     1.6  {
     1.7 -	int i;
     1.8 +	int i, num_anim;
     1.9  	free(node->name);
    1.10  
    1.11 -	for(i=0; i<ANM_NUM_TRACKS; i++) {
    1.12 +	num_anim = anm_get_animation_count(node);
    1.13 +	for(i=0; i<num_anim; i++) {
    1.14  		anm_destroy_animation(node->animations + i);
    1.15  	}
    1.16  	dynarr_free(node->animations);