Dispose Children when Parent is being disposed. 17/155117/1
authorUmar <m.umar@partner.samsung.com>
Mon, 25 Sep 2017 19:05:55 +0000 (20:05 +0100)
committerdongsug.song <dongsug.song@samsung.com>
Thu, 12 Oct 2017 05:41:43 +0000 (14:41 +0900)
Change-Id: I1c90f2dbc822f1fde25df5aef888f41959ee9cf4

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

index ecf7b1a..3f23151 100755 (executable)
@@ -159,6 +159,13 @@ namespace Tizen.NUI.BaseComponents
             }
 
             base.Dispose(type);
+
+            // Dispose all Children of this View.
+            foreach (View childView in Children)
+            {
+                childView?.Dispose();
+            }
+            Children.Clear();
         }
 
         private void DisConnectFromSignals()
index e62d647..0be286e 100755 (executable)
@@ -124,6 +124,13 @@ namespace Tizen.NUI
             }
 
             base.Dispose(type);
+
+            // Dispose all Children of this Layer.
+            foreach (View childView in Children)
+            {
+                childView?.Dispose();
+            }
+            Children.Clear();
         }