Unparented layout should disconnect all signals connected to the owner. 34/191134/1
authorAnton Obzhirov <a.obzhirov@samsung.com>
Thu, 11 Oct 2018 15:46:35 +0000 (16:46 +0100)
committerAnton Obzhirov <a.obzhirov@samsung.com>
Thu, 11 Oct 2018 15:46:35 +0000 (16:46 +0100)
Change-Id: Iaecc7fcdbd11e65ae6f560512a84a9e3b2912426

dali-toolkit/devel-api/layouting/layout-group-impl.cpp

index 856ca18..bd8c68a 100644 (file)
@@ -561,6 +561,15 @@ void LayoutGroup::OnUnparent()
 {
   // Remove children
   RemoveAll();
+
+  auto control = Toolkit::Control::DownCast( GetOwner() );
+  if( control )
+  {
+    DevelActor::ChildAddedSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::ChildAddedToOwner );
+    DevelActor::ChildRemovedSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::ChildRemovedFromOwner );
+    DevelActor::ChildOrderChangedSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::ChildOrderChanged );
+    DevelHandle::PropertySetSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::OnOwnerPropertySet );
+  }
 }
 
 void LayoutGroup::RemoveChild( LayoutItem& item )