From d290c26db158699422b9d58990f02e28f9207332 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Fri, 10 May 2019 12:13:30 +0100 Subject: [PATCH] Shutdown ISteamMatchmakingServers properly --- Facepunch.Steamworks/ServerList/Base.cs | 8 ++++++++ Facepunch.Steamworks/SteamClient.cs | 1 + 2 files changed, 9 insertions(+) diff --git a/Facepunch.Steamworks/ServerList/Base.cs b/Facepunch.Steamworks/ServerList/Base.cs index b119a1b..4c2fa5b 100644 --- a/Facepunch.Steamworks/ServerList/Base.cs +++ b/Facepunch.Steamworks/ServerList/Base.cs @@ -27,6 +27,11 @@ internal static ISteamMatchmakingServers Internal } } + internal static void Shutdown() + { + _internal = null; + } + #endregion @@ -85,6 +90,9 @@ public virtual async Task RunQueryAsync( float timeoutSeconds = 10 ) if ( request.Value == IntPtr.Zero || thisRequest.Value != request.Value ) return false; + if ( !SteamClient.IsValid ) + return false; + var r = Responsive.Count; UpdatePending(); diff --git a/Facepunch.Steamworks/SteamClient.cs b/Facepunch.Steamworks/SteamClient.cs index ec60c64..0c5488b 100644 --- a/Facepunch.Steamworks/SteamClient.cs +++ b/Facepunch.Steamworks/SteamClient.cs @@ -81,6 +81,7 @@ public static void Shutdown() SteamParties.Shutdown(); SteamNetworkingUtils.Shutdown(); SteamNetworkingSockets.Shutdown(); + ServerList.Base.Shutdown(); SteamAPI.Shutdown(); }