[Tizen] generate exception when garbage collected during animation playing
authorminho.sun <minho.sun@samsung.com>
Mon, 14 Aug 2017 08:11:38 +0000 (17:11 +0900)
committerminho.sun <minho.sun@samsung.com>
Mon, 14 Aug 2017 08:11:44 +0000 (17:11 +0900)
This reverts commit 83c19fd5f7969237d09a63b248eb16a104d29c1b.

Change-Id: Ic4ff5563b08e3aaad49f56e917cf25b40b8cfec3

src/Tizen.NUI/src/public/Animation.cs

index ba4e606..d023cf3 100755 (executable)
@@ -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)