Skip to content

Commit 0688898

Browse files
committed
* Additional _disposed checks in AutorecoveringChannel.
1 parent a25c1b6 commit 0688898

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

projects/RabbitMQ.Client/Impl/AutorecoveringChannel.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,23 @@ await _connection.DeleteRecordedChannelAsync(this,
254254
public override string ToString()
255255
=> InnerChannel.ToString();
256256

257-
public void Dispose() => DisposeAsync().AsTask().GetAwaiter().GetResult();
257+
public void Dispose()
258+
{
259+
if (_disposed)
260+
{
261+
return;
262+
}
263+
264+
DisposeAsync().AsTask().GetAwaiter().GetResult();
265+
}
258266

259267
public async ValueTask DisposeAsync()
260268
{
269+
if (_disposed)
270+
{
271+
return;
272+
}
273+
261274
if (IsDisposing)
262275
{
263276
return;

0 commit comments

Comments
 (0)