[NUI] Fix crash on ScrollableBase.Dispose()
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 27 Oct 2022 02:28:39 +0000 (11:28 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 10 Nov 2022 01:25:11 +0000 (10:25 +0900)
In ScrollableBase.Dispose(), propertyNotification is disposed as well.
To dispose propertyNotification, RemovePropertyNotifications was called
inappropriately and it caused crash.

To resolve the above, RemovePropertyNotification is called by
ContentContainer with propertyNotification like AddPropertyNotification
is called by ContentContainer with propertyNotification.

src/Tizen.NUI.Components/Controls/ScrollableBase.cs

index bfac755..0f2f477 100755 (executable)
@@ -1342,8 +1342,8 @@ namespace Tizen.NUI.Components
 
             if (propertyNotification != null)
             {
+                ContentContainer?.RemovePropertyNotification(propertyNotification);
                 propertyNotification.Notified -= OnPropertyChanged;
-                Interop.Handle.RemovePropertyNotifications(propertyNotification.SwigCPtr);
                 propertyNotification.Dispose();
                 propertyNotification = null;
             }