Эх сурвалжийг харах

Fixed crash from freeing previous twice.

NathanSweet 12 жил өмнө
parent
commit
821c9ea38b

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

@@ -171,7 +171,10 @@ void AnimationState_clearTrack (AnimationState* self, int trackIndex) {
 
 
 	self->tracks[trackIndex] = 0;
 	self->tracks[trackIndex] = 0;
 	_TrackEntry_disposeAll(current);
 	_TrackEntry_disposeAll(current);
-	if (current->previous) _TrackEntry_dispose(current->previous);
+	if (current->previous) {
+		_TrackEntry_dispose(current->previous);
+		current->previous = 0;
+	}
 }
 }
 
 
 TrackEntry* _AnimationState_expandToIndex (AnimationState* self, int index) {
 TrackEntry* _AnimationState_expandToIndex (AnimationState* self, int index) {