[NUI] Fix not to dispose LayoutManager in FlexibleView (#1763)
authorjaehyun0cho <jaehyun0cho@gmail.com>
Mon, 29 Jun 2020 11:46:57 +0000 (20:46 +0900)
committerGitHub <noreply@github.com>
Mon, 29 Jun 2020 11:46:57 +0000 (20:46 +0900)
Since LayoutManager handle mLayout is not constructed by FlexibleView,
mLayout is not disposed but its member handles are cleared.

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs
src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleViewLayoutManager.cs

index 1ee4aad..5f2df59 100755 (executable)
@@ -449,7 +449,7 @@ namespace Tizen.NUI.Components
                 if (mLayout != null)
                 {
                     mLayout.StopScroll(false);
-                    mLayout.Dispose();
+                    mLayout.ClearRecyclerView();
                     mLayout = null;
                 }
 
index b22a1e4..26b66f9 100755 (executable)
@@ -739,6 +739,12 @@ namespace Tizen.NUI.Components
             mChildHelper = recyclerView.GetChildHelper();
         }
 
+        internal void ClearRecyclerView()
+        {
+            mFlexibleView = null;
+            mChildHelper = null;
+        }
+
         internal void StopScroll(bool doSomethingAfterAnimationStopped)
         {
             if (mScrollAni != null && mScrollAni.State == Animation.States.Playing)