Skip to content

Commit

Permalink
* Restore IsOpen check
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Apr 25, 2024
1 parent 77fc4ea commit 0c7cf52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion projects/RabbitMQ.Client/client/impl/ChannelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,10 @@ protected virtual void Dispose(bool disposing)
{
try
{
this.AbortAsync().GetAwaiter().GetResult();
if (IsOpen)
{
this.AbortAsync().GetAwaiter().GetResult();
}
ConsumerDispatcher.Dispose();
_rpcSemaphore.Dispose();
_confirmSemaphore?.Dispose();
Expand Down
5 changes: 4 additions & 1 deletion projects/RabbitMQ.Client/client/impl/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,10 @@ private void Dispose(bool disposing)
{
try
{
this.AbortAsync().GetAwaiter().GetResult();
if (IsOpen)
{
this.AbortAsync().GetAwaiter().GetResult();
}
_session0.Dispose();
_mainLoopCts.Dispose();
_sessionManager.Dispose();
Expand Down

0 comments on commit 0c7cf52

Please sign in to comment.