Undo broken change in un-watching empty view observer;
authorE.Z. Hart <hartez@gmail.com>
Mon, 24 Jun 2019 19:47:46 +0000 (13:47 -0600)
committerE.Z. Hart <hartez@gmail.com>
Mon, 24 Jun 2019 19:47:46 +0000 (13:47 -0600)
This may cause a small leak in some corner cases, but that leak is fixed by

Xamarin.Forms.Platform.Android/CollectionView/ItemsViewRenderer.cs

index 498be84..6703e78 100644 (file)
@@ -222,6 +222,9 @@ namespace Xamarin.Forms.Platform.Android
                                return;
                        }
 
+                       // Stop watching the old adapter to see if it's empty (if we are watching)
+                       Unwatch(ItemsViewAdapter ?? GetAdapter());
+
                        UpdateAdapter();
 
                        UpdateEmptyView();
@@ -231,9 +234,6 @@ namespace Xamarin.Forms.Platform.Android
                {
                        var oldItemViewAdapter = ItemsViewAdapter;
 
-                       // Stop watching the old adapter to see if it's empty (if we are watching)
-                       Unwatch(oldItemViewAdapter);
-
                        ItemsViewAdapter = new ItemsViewAdapter(ItemsView);
 
                        SwapAdapter(ItemsViewAdapter, true);