From f63e1625abe45789640d18aa29b3e53a929b9e6d Mon Sep 17 00:00:00 2001 From: badlogic Date: Mon, 28 Nov 2016 15:08:17 +0100 Subject: [PATCH] [c] Need to dispose mixingFrom explicitely in spAnimationState_disposeTracks, instead of disposeTrack. A mixingFrom entry may be smoked as part of disposing its parent before an event for the mixing from entry is processed in the event queue. --- spine-c/src/spine/AnimationState.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spine-c/src/spine/AnimationState.c b/spine-c/src/spine/AnimationState.c index cbc8ebb57..82e92b072 100644 --- a/spine-c/src/spine/AnimationState.c +++ b/spine-c/src/spine/AnimationState.c @@ -175,7 +175,6 @@ void _spEventQueue_drain (_spEventQueue* self) { } void _spAnimationState_disposeTrackEntry (spTrackEntry* entry) { - if (entry->mixingFrom) _spAnimationState_disposeTrackEntry(entry->mixingFrom); FREE(entry->timelinesFirst); FREE(entry->timelinesRotation); FREE(entry); @@ -185,6 +184,12 @@ void _spAnimationState_disposeTrackEntries (spAnimationState* state, spTrackEntr while (entry) { spTrackEntry* next = entry->next; _spAnimationState_disposeTrackEntry(entry); + spTrackEntry* from = entry->mixingFrom; + while (from) { + spTrackEntry* nextFrom = from->mixingFrom; + _spAnimationState_disposeTrackEntry(from); + from = nextFrom; + } entry = next; } }