[Tizen] Stop observing visuals when a control is destroyed
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 19 Nov 2020 05:34:59 +0000 (14:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 19 Nov 2020 05:35:11 +0000 (14:35 +0900)
Change-Id: I4f05c904765c3fd2798a317e44ac210dcc21e589

dali-toolkit/internal/controls/control/control-data-impl.cpp

index df01b27..9182c1f 100755 (executable)
@@ -459,6 +459,16 @@ Control::Impl::Impl( Control& controlImpl )
 
 Control::Impl::~Impl()
 {
+  for( auto&& iter : mVisuals )
+  {
+    StopObservingVisual( iter->visual );
+  }
+
+  for( auto&& iter : mRemoveVisuals )
+  {
+    StopObservingVisual( iter->visual );
+  }
+
   AccessibilityDeregister();
   // All gesture detectors will be destroyed so no need to disconnect.
   delete mStartingPinchScale;