From cb85e41c525b094499e06f82f9005aedf4cf0f40 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 7 Jul 2016 13:34:42 +0100 Subject: [PATCH] Close pipes properly --- Facepunch.Steamworks/Client.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index cc4998a..062cb55 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -48,6 +48,19 @@ public void Dispose() { if ( _client != null ) { + if ( _hpipe > 0 ) + { + if ( _huser > 0 ) + _client.ReleaseUser( _hpipe, _huser ); + + _client.BReleaseSteamPipe( _hpipe ); + + _huser = 0; + _hpipe = 0; + } + + _friends = null; + _client.BShutdownIfAllPipesClosed(); _client = null; }