[Tizen] generate exception when garbage collected during animation playing
authordongsug.song <dongsug.song@samsung.com>
Tue, 25 Jul 2017 02:05:45 +0000 (11:05 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Tue, 25 Jul 2017 02:07:14 +0000 (11:07 +0900)
This reverts commit 5fdcb8538cc8dde0a48d1646daaf7f9b2788c52b.

Change-Id: I4f9624e9fec59146675eba14708d93e37d1ca3cc

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

index d999316..83b129f 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.