Skip to content

Commit

Permalink
* Additional _disposed checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Jan 10, 2025
1 parent 29a1f7a commit 2796656
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions projects/RabbitMQ.Client/Impl/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ void IDisposable.Dispose()

protected virtual void Dispose(bool disposing)
{
if (_disposed)
{
return;
}

if (IsDisposing)
{
return;
Expand Down Expand Up @@ -559,6 +564,11 @@ protected virtual void Dispose(bool disposing)

public async ValueTask DisposeAsync()
{
if (_disposed)
{
return;
}

await DisposeAsyncCore()
.ConfigureAwait(false);

Expand All @@ -567,6 +577,11 @@ await DisposeAsyncCore()

protected virtual async ValueTask DisposeAsyncCore()
{
if (_disposed)
{
return;
}

if (IsDisposing)
{
return;
Expand Down

0 comments on commit 2796656

Please sign in to comment.