From 5f38c6151960f62a7577fa5fed98f21236b513c5 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Tue, 1 Aug 2017 10:36:09 +0900 Subject: [PATCH] [Tizen] generate exception when garbage collected during animation playing This reverts commit 2586141be0d81d1915456e766004772469176590. Change-Id: Iac5266be02187de1bbc85a4bda06c849845faafc --- Tizen.NUI/src/public/Animation.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Tizen.NUI/src/public/Animation.cs b/Tizen.NUI/src/public/Animation.cs index 47815a6..3169ad3 100755 --- a/Tizen.NUI/src/public/Animation.cs +++ b/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. -- 2.7.4