[NUI] Fix WidgetView dispose issue 74/157374/2
authorminho.sun <minho.sun@samsung.com>
Tue, 24 Oct 2017 08:50:22 +0000 (17:50 +0900)
committerminho.sun <minho.sun@samsung.com>
Wed, 25 Oct 2017 07:40:47 +0000 (16:40 +0900)
Fix WidgetView dispose issue.

It caused by using old-type of dispose pattern in WidgetView.

Change-Id: I1e1aca19066f333be1345d7fef62bc7e5b870bf5
Signed-off-by: minho.sun <minho.sun@samsung.com>
src/Tizen.NUI/src/public/Widget.cs
src/Tizen.NUI/src/public/WidgetView.cs

index 930a46fbc3edee691eb9e81d14a3c44ade84da35..35fed51c6e657ade480e6fc5e121b0f18924b23e 100755 (executable)
@@ -16,7 +16,6 @@
  */
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
 
 namespace Tizen.NUI
 {
@@ -57,6 +56,35 @@ namespace Tizen.NUI
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
+            if (_createCallback != null)
+            {
+                this.CreateSignal().Disconnect(_createCallback);
+            }
+
+            if (_pauseCallback != null)
+            {
+                this.PauseSignal().Disconnect(_pauseCallback);
+            }
+
+            if (_resizeCallback != null)
+            {
+                this.ResizeSignal().Disconnect(_resizeCallback);
+            }
+
+            if (_resumeCallback != null)
+            {
+                this.ResumeSignal().Disconnect(_resumeCallback);
+            }
+
+            if (_terminateCallback != null)
+            {
+                this.TerminateSignal().Disconnect(_terminateCallback);
+            }
+
+            if (_updateCallback != null)
+            {
+                this.UpdateSignal().Disconnect(_updateCallback);
+            }
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
@@ -621,4 +649,4 @@ namespace Tizen.NUI
             Resume = 4
         }
     }
-}
\ No newline at end of file
+}
index b97177f1366973a7cf01a2c0f7feef2dd0acca93..f5bddb77c031afc870d74be4f497bdcf7c653738 100755 (executable)
@@ -70,6 +70,37 @@ namespace Tizen.NUI
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
+
+            if (_widgetAddedEventCallback != null)
+            {
+                this.WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
+            }
+
+            if (_widgetContentUpdatedEventCallback != null)
+            {
+                this.WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
+            }
+
+            if (_widgetCreationAbortedEventCallback != null)
+            {
+                this.WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
+            }
+
+            if (_widgetDeletedEventCallback != null)
+            {
+                this.WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
+            }
+
+            if (_widgetFaultedEventCallback != null)
+            {
+                this.WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
+            }
+
+            if (_widgetUpdatePeriodChangedEventCallback != null)
+            {
+                this.WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -79,7 +110,7 @@ namespace Tizen.NUI
                 }
                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
             }
-            base.Dispose();
+            base.Dispose(type);
         }
 
         internal new class Property
@@ -737,4 +768,4 @@ namespace Tizen.NUI
 
     }
 
-}
\ No newline at end of file
+}