[NUI] Fix the propertyNotification to be disposed in ScrollableBase
authordongsug.song <dongsug.song@samsung.com>
Mon, 17 Oct 2022 07:51:48 +0000 (16:51 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 10 Nov 2022 01:25:11 +0000 (10:25 +0900)
src/Tizen.NUI.Components/Controls/ScrollableBase.cs

index 231880d..bfac755 100755 (executable)
@@ -1330,19 +1330,27 @@ namespace Tizen.NUI.Components
                 return;
             }
 
-            if (type == DisposeTypes.Explicit)
-            {
-                StopOverShootingShadowAnimation();
-                StopScroll();
+            StopOverShootingShadowAnimation();
+            StopScroll();
 
-                if (mPanGestureDetector != null)
-                {
-                    mPanGestureDetector.Detected -= OnPanGestureDetected;
-                    mPanGestureDetector.Dispose();
-                    mPanGestureDetector = null;
-                }
+            if (mPanGestureDetector != null)
+            {
+                mPanGestureDetector.Detected -= OnPanGestureDetected;
+                mPanGestureDetector.Dispose();
+                mPanGestureDetector = null;
+            }
 
+            if (propertyNotification != null)
+            {
+                propertyNotification.Notified -= OnPropertyChanged;
+                Interop.Handle.RemovePropertyNotifications(propertyNotification.SwigCPtr);
                 propertyNotification.Dispose();
+                propertyNotification = null;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+
             }
             base.Dispose(type);
         }