From f186736ba39c70212bb41da2be40e1d03b20ee23 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 24 May 2019 21:35:41 +0300 Subject: [PATCH] Release steam pipes only if they exist --- SAM.API/Client.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SAM.API/Client.cs b/SAM.API/Client.cs index edbed7d..0347d59 100644 --- a/SAM.API/Client.cs +++ b/SAM.API/Client.cs @@ -91,10 +91,14 @@ namespace SAM.API ~Client() { - if (this.SteamClient != null) + if (this.SteamClient != null && this._Pipe > 0) { - this.SteamClient.ReleaseUser(this._Pipe, this._User); - this._User = 0; + if (this._User > 0) + { + this.SteamClient.ReleaseUser(this._Pipe, this._User); + this._User = 0; + } + this.SteamClient.ReleaseSteamPipe(this._Pipe); this._Pipe = 0; }