Skip to content

Commit 7348bc2

Browse files
committed
Merge pull request #757 from rabbitmq/lrb-fix-timer-disposed-exception
Catch ObjectDisposedException case (cherry picked from commit 313e1e8)
1 parent dad1f2d commit 7348bc2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ public void HeartbeatWriteTimerCallback(object state)
11221122
if (!m_closed)
11231123
{
11241124
WriteFrame(m_heartbeatFrame);
1125+
_heartbeatWriteTimer?.Change((int)m_heartbeatTimeSpan.TotalMilliseconds, Timeout.Infinite);
11251126
}
11261127
}
11271128
catch (ObjectDisposedException)
@@ -1134,11 +1135,6 @@ public void HeartbeatWriteTimerCallback(object state)
11341135
// ignore, let the read callback detect
11351136
// peer unavailability. See rabbitmq/rabbitmq-dotnet-client#638 for details.
11361137
}
1137-
1138-
if (m_closed == false)
1139-
{
1140-
_heartbeatWriteTimer?.Change((int)m_heartbeatTimeSpan.TotalMilliseconds, Timeout.Infinite);
1141-
}
11421138
}
11431139

11441140
protected void MaybeStopHeartbeatTimers()

0 commit comments

Comments
 (0)