libanim

diff src/anim.c @ 26:b52f3e23e06f

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 ebead35c9eb1
children 70ad14ba4df2
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);