[NUI] Fix implicit dispose exception defect
authorDongsug Song <dongsug.song@samsung.com>
Wed, 9 Jun 2021 02:07:45 +0000 (11:07 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 9 Jun 2021 03:12:19 +0000 (12:12 +0900)
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs

index dcc801e..a51b48b 100755 (executable)
@@ -1144,14 +1144,17 @@ namespace Tizen.NUI.BaseComponents
             //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 (this != null)
+
+            // equivalent to "if (this != null)". more clear to understand.
+            if (this.HasBody())
             {
                 DisConnectFromSignals();
-            }
 
-            foreach (View view in Children)
-            {
-                view.InternalParent = null;
+                foreach (View view in Children)
+                {
+                    view.InternalParent = null;
+                }
+
             }
 
             base.Dispose(type);