In SlackConnection.Close the _pingPongMonitor is not stopped. Therefore the Timer in the ping-pong monitor keeps a reference and holds the connection alive (no GC) + it tries to ping-pong every 5 s although I closed the corresponding SlackConnection.
I suggest adding a method StopMonitor to IPingPongMonitor which disables the timer:
public void StopMonitor()
{
_timer?.Dispose();
_timer = null;
}
Any objections?
Best regards,
D.R.
In
SlackConnection.Closethe_pingPongMonitoris not stopped. Therefore the Timer in the ping-pong monitor keeps a reference and holds the connection alive (no GC) + it tries to ping-pong every 5 s although I closed the corresponding SlackConnection.I suggest adding a method
StopMonitortoIPingPongMonitorwhich disables the timer:Any objections?
Best regards,
D.R.