[Tizen] generate exception when garbage collected during animation playing
authorminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:36:09 +0000 (10:36 +0900)
committerminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:36:12 +0000 (10:36 +0900)
This reverts commit 2586141be0d81d1915456e766004772469176590.

Change-Id: Iac5266be02187de1bbc85a4bda06c849845faafc

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

index 47815a6..3169ad3 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");
+                }
             }
 
             //Release your own unmanaged resources here.