From 5611694b90153fa822ec5b76d67030edee51b50a Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 28 Jul 2016 18:27:01 +0200 Subject: [PATCH] Misc --- ArchiSteamFarm/WCF.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/WCF.cs b/ArchiSteamFarm/WCF.cs index 59c755d85..8da8ee4ad 100644 --- a/ArchiSteamFarm/WCF.cs +++ b/ArchiSteamFarm/WCF.cs @@ -76,8 +76,8 @@ namespace ArchiSteamFarm { } public void Dispose() { - ServiceHost?.Close(); Client?.Close(); + StopServer(); } internal bool IsServerRunning() => ServiceHost != null; @@ -113,7 +113,14 @@ namespace ArchiSteamFarm { return; } - ServiceHost.Close(); + if (ServiceHost.State != CommunicationState.Closed) { + try { + ServiceHost.Close(); + } catch (Exception e) { + Logging.LogGenericException(e); + } + } + ServiceHost = null; }