Skip to content

Commit 85890a4

Browse files
david-poiriermichaelklishin
authored andcommitted
Stop Heartbeat timers before disposing them, to prevent any further callbacks and allow background threads to exit
1 parent c8b98b5 commit 85890a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

projects/client/RabbitMQ.Client/src/client/impl/Connection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,10 +987,12 @@ protected void MaybeStopHeartbeatTimers()
987987
{
988988
if(_heartbeatReadTimer != null)
989989
{
990+
_heartbeatReadTimer.Change(Timeout.Infinite, Timeout.Infinite);
990991
_heartbeatReadTimer.Dispose();
991992
}
992993
if(_heartbeatWriteTimer != null)
993994
{
995+
_heartbeatWriteTimer.Change(Timeout.Infinite, Timeout.Infinite);
994996
_heartbeatWriteTimer.Dispose();
995997
}
996998
}

0 commit comments

Comments
 (0)