Skip to content

Commit 1de5766

Browse files
committed
Dispose HttpWebSocket if created
1 parent d644f03 commit 1de5766

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/GraphQL.Client/GraphQLHttpClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ protected virtual void Dispose(bool disposing)
188188
Debug.WriteLine($"Disposing GraphQLHttpClient on endpoint {Options.EndPoint}");
189189
_cancellationTokenSource.Cancel();
190190
HttpClient.Dispose();
191-
if(_lazyHttpWebSocket?.HasValue) _lazyHttpWebSocket?.Value.Dispose();
191+
if ( (bool)(_lazyHttpWebSocket?.IsValueCreated) )
192+
_lazyHttpWebSocket?.Value.Dispose();
192193
_cancellationTokenSource.Dispose();
193194
}
194195
}

0 commit comments

Comments
 (0)