Release steam pipes only if they exist

This commit is contained in:
Pavel Djundik
2019-05-24 21:35:41 +03:00
committed by GitHub
parent 9f3ab7c813
commit f186736ba3

View File

@@ -91,10 +91,14 @@ namespace SAM.API
~Client() ~Client()
{ {
if (this.SteamClient != null) if (this.SteamClient != null && this._Pipe > 0)
{ {
this.SteamClient.ReleaseUser(this._Pipe, this._User); if (this._User > 0)
this._User = 0; {
this.SteamClient.ReleaseUser(this._Pipe, this._User);
this._User = 0;
}
this.SteamClient.ReleaseSteamPipe(this._Pipe); this.SteamClient.ReleaseSteamPipe(this._Pipe);
this._Pipe = 0; this._Pipe = 0;
} }