[Tizen] generate exception when garbage collected during animation playing
authordongsug.song <dongsug.song@samsung.com>
Wed, 19 Jul 2017 06:59:07 +0000 (15:59 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Wed, 19 Jul 2017 06:59:07 +0000 (15:59 +0900)
Change-Id: I4e7ac6436cfd8123a216125d442ac0e15a8e6f0e
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
src/Tizen.NUI/src/public/Animation.cs

index d999316..4f92f82 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.