[NUI] Enable Window.ViewAdded event
authorDongsug Song <dongsug.song@samsung.com>
Fri, 5 Mar 2021 07:41:07 +0000 (16:41 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 5 Mar 2021 08:54:38 +0000 (17:54 +0900)
- Previously, Window.ViewAdded event was blocked by memory leak
- This is enabled again by the request from Appium
- This change has beend checked locally and there was no memory leak (normal)

src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs

index f8377a2..7bd991a 100755 (executable)
@@ -136,9 +136,8 @@ namespace Tizen.NUI.BaseComponents
                 PositionUsesPivotPoint = false;
             }
 
-            //ToDo: this has memory leak and this is not used currently. will be fixed soon by using Event subscribing pattern.
-            //_onWindowSendEventCallback = SendViewAddedEventToWindow;
-            //this.OnWindowSignal().Connect(_onWindowSendEventCallback);
+            _onWindowSendEventCallback = SendViewAddedEventToWindow;
+            this.OnWindowSignal().Connect(_onWindowSendEventCallback);
 
             if (!shown)
             {
index e60aaa0..11b06d2 100755 (executable)
@@ -1218,6 +1218,7 @@ namespace Tizen.NUI.BaseComponents
             if (_onWindowSendEventCallback != null)
             {
                 this.OnWindowSignal().Disconnect(_onWindowSendEventCallback);
+                _onWindowSendEventCallback = null;
             }
 
             // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.