From 5716700c00e7a7e32f81ac49966f8debbd9e62a2 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Mon, 14 Aug 2017 17:11:38 +0900 Subject: [PATCH] [Tizen] generate exception when garbage collected during animation playing This reverts commit 83c19fd5f7969237d09a63b248eb16a104d29c1b. Change-Id: Ic4ff5563b08e3aaad49f56e917cf25b40b8cfec3 --- src/Tizen.NUI/src/public/Animation.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI/src/public/Animation.cs b/src/Tizen.NUI/src/public/Animation.cs index ba4e606..d023cf3 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"); + } } if (_animationFinishedEventCallback != null) -- 2.7.4