goat3d

diff libs/anim/anim.c @ 56:ca549434dc95

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:50:54 +0200
parents 0ecb788a87f7
children
line diff
     1.1 --- a/libs/anim/anim.c	Sun Jan 19 14:56:44 2014 +0200
     1.2 +++ b/libs/anim/anim.c	Thu Jan 23 02:50:54 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);