Browse Source

Fixed clearAnimation(int) crash.

NathanSweet 12 years ago
parent
commit
10fa956f39
1 changed files with 1 additions and 4 deletions
  1. 1 4
      spine-c/src/spine/AnimationState.c

+ 1 - 4
spine-c/src/spine/AnimationState.c

@@ -174,11 +174,8 @@ void AnimationState_clearTrack (AnimationState* self, int trackIndex) {
 	if (self->listener) self->listener(self, trackIndex, ANIMATION_END, 0, 0);
 	if (self->listener) self->listener(self, trackIndex, ANIMATION_END, 0, 0);
 
 
 	self->tracks[trackIndex] = 0;
 	self->tracks[trackIndex] = 0;
+	if (current->previous) _TrackEntry_dispose(current->previous);
 	_TrackEntry_disposeAll(current);
 	_TrackEntry_disposeAll(current);
-	if (current->previous) {
-		_TrackEntry_dispose(current->previous);
-		current->previous = 0;
-	}
 }
 }
 
 
 TrackEntry* _AnimationState_expandToIndex (AnimationState* self, int index) {
 TrackEntry* _AnimationState_expandToIndex (AnimationState* self, int index) {