From 7d5e01adba79e09cecab61e5fba12246838341c4 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Sun, 2 Jul 2023 13:54:46 +0200 Subject: [PATCH] Merge pull request #2091 from xamarin/fix-1996 Remove wrong Connectivity dispose calls on Android --- Xamarin.Essentials/Connectivity/Connectivity.android.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xamarin.Essentials/Connectivity/Connectivity.android.cs b/Xamarin.Essentials/Connectivity/Connectivity.android.cs index 21123f6c2..58deaef2a 100644 --- a/Xamarin.Essentials/Connectivity/Connectivity.android.cs +++ b/Xamarin.Essentials/Connectivity/Connectivity.android.cs @@ -59,7 +59,7 @@ static void StopListeners() { Debug.WriteLine("Connectivity receiver already unregistered. Disposing of it."); } - conectivityReceiver.Dispose(); + conectivityReceiver = null; } @@ -88,7 +88,6 @@ static void UnregisterNetworkCallback() manager.UnregisterNetworkCallback(networkCallback); - networkCallback?.Dispose(); networkCallback = null; }