From dc8f89fd65a03fde7d0fb039b0a1724f9513bbda Mon Sep 17 00:00:00 2001 From: John Date: Thu, 15 Dec 2016 05:58:49 +0800 Subject: [PATCH] [csharp] Fix recursion in clearTracks. Issue: https://github.com/EsotericSoftware/spine-runtimes/issues/805 based on https://github.com/EsotericSoftware/spine-runtimes/commit/f6cf88103c861f4312d7c33c56ae81eae289bc59 and https://github.com/EsotericSoftware/spine-runtimes/commit/7dbf7c5268beccbaaf083f4933f5ea4c0d8ef42c --- spine-csharp/src/AnimationState.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spine-csharp/src/AnimationState.cs b/spine-csharp/src/AnimationState.cs index 684299638..8ba41b284 100644 --- a/spine-csharp/src/AnimationState.cs +++ b/spine-csharp/src/AnimationState.cs @@ -343,12 +343,13 @@ namespace Spine { /// It may be desired to use to mix the skeletons back to the setup pose, /// rather than leaving them in their previous pose. public void ClearTracks () { + bool oldDrainDisabled = queue.drainDisabled; queue.drainDisabled = true; for (int i = 0, n = tracks.Count; i < n; i++) { ClearTrack(i); } tracks.Clear(); - queue.drainDisabled = false; + queue.drainDisabled = oldDrainDisabled; queue.Drain(); } @@ -510,12 +511,13 @@ namespace Spine { /// /// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration. public void SetEmptyAnimations (float mixDuration) { + bool oldDrainDisabled = queue.drainDisabled; queue.drainDisabled = true; for (int i = 0, n = tracks.Count; i < n; i++) { TrackEntry current = tracks.Items[i]; if (current != null) SetEmptyAnimation(i, mixDuration); } - queue.drainDisabled = false; + queue.drainDisabled = oldDrainDisabled; queue.Drain(); }