Skip to content

Commit 3aa42f7

Browse files
committed
Stop Heartbeat timers before disposing them, to prevent any further callbacks and allow background threads to exit
1 parent a184de6 commit 3aa42f7

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
@@ -1094,10 +1094,12 @@ protected void MaybeStopHeartbeatTimers()
10941094
{
10951095
if(_heartbeatReadTimer != null)
10961096
{
1097+
_heartbeatReadTimer.Change(Timeout.Infinite, Timeout.Infinite);
10971098
_heartbeatReadTimer.Dispose();
10981099
}
10991100
if(_heartbeatWriteTimer != null)
11001101
{
1102+
_heartbeatWriteTimer.Change(Timeout.Infinite, Timeout.Infinite);
11011103
_heartbeatWriteTimer.Dispose();
11021104
}
11031105
}

0 commit comments

Comments
 (0)