From 6cff58f79532c063cc4c1c3183596f1f39834432 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Wed, 19 Jul 2017 15:59:07 +0900 Subject: [PATCH] [Tizen] generate exception when garbage collected during animation playing Change-Id: I4e7ac6436cfd8123a216125d442ac0e15a8e6f0e Signed-off-by: dongsug.song --- 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 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. -- 2.7.4