Skip to content

Commit 1f46e49

Browse files
authored
Merge pull request #1160 from rabbitmq/rabbitmq-dotnet-client-1154-7.x
Merge pull request #1154 from ricado-group/1153-semaphore-disposed-ex…
2 parents 3365ff6 + 78d6053 commit 1f46e49

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

projects/RabbitMQ.Client/client/impl/AsyncConsumerWorkService.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,14 @@ private static async Task HandleConcurrent(Work work, IModel model, SemaphoreSli
178178
finally
179179
{
180180
work.PostExecute();
181-
limiter.Release();
181+
182+
try
183+
{
184+
limiter.Release();
185+
}
186+
catch (ObjectDisposedException) // Prevents Exceptions in the Task's finalizer when the WorkPool is Stopped
187+
{
188+
}
182189
}
183190
}
184191

0 commit comments

Comments
 (0)