Skip to content

Commit a25c1b6

Browse files
committed
* Additional _disposed checks.
1 parent 2de26be commit a25c1b6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

projects/RabbitMQ.Client/Impl/Channel.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,11 @@ void IDisposable.Dispose()
529529

530530
protected virtual void Dispose(bool disposing)
531531
{
532+
if (_disposed)
533+
{
534+
return;
535+
}
536+
532537
if (IsDisposing)
533538
{
534539
return;
@@ -559,6 +564,11 @@ protected virtual void Dispose(bool disposing)
559564

560565
public async ValueTask DisposeAsync()
561566
{
567+
if (_disposed)
568+
{
569+
return;
570+
}
571+
562572
await DisposeAsyncCore()
563573
.ConfigureAwait(false);
564574

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

568578
protected virtual async ValueTask DisposeAsyncCore()
569579
{
580+
if (_disposed)
581+
{
582+
return;
583+
}
584+
570585
if (IsDisposing)
571586
{
572587
return;

0 commit comments

Comments
 (0)