From: dongsug.song Date: Wed, 19 Jul 2017 06:59:07 +0000 (+0900) Subject: [Tizen] generate exception when garbage collected during animation playing X-Git-Tag: submit/trunk/20170823.075128~91^2~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cff58f79532c063cc4c1c3183596f1f39834432;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Tizen] generate exception when garbage collected during animation playing Change-Id: I4e7ac6436cfd8123a216125d442ac0e15a8e6f0e Signed-off-by: dongsug.song --- diff --git a/src/Tizen.NUI/src/public/Animation.cs b/src/Tizen.NUI/src/public/Animation.cs index d999316..4f92f82 100755 --- a/src/Tizen.NUI/src/public/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation.cs @@ -53,12 +53,29 @@ namespace Tizen.NUI { return; } - if(type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. //You should release all of your own disposable objects here. + NUILog.Debug("Animation.Dispose(Explicit)! GetState=" + this.GetState()); + if(this.GetState() != States.Stopped) + { + this.Clear(); + this.Reset(); + NUILog.Error("Now Animation is playing! Clear and Reset here!"); + } + } + else if(type == DisposeTypes.Implicit) + { + NUILog.Debug("Animation.Dispose(Implicit)! GetState=" + this.GetState()); + if(this.GetState() != States.Stopped) + { + this.Clear(); + this.Reset(); + NUILog.Error("Now Animation is playing! Clear and Reset here!"); + throw new System.InvalidOperationException("Animation Instance should not be disposed until getting Finished event. Should be a global variable"); + } } //Release your own unmanaged resources here.