From 5a87e9b0a5830824f90b5bf3742370c167619b71 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 3 Jul 2020 06:29:54 -0700 Subject: [PATCH] quic: cleanup timers if they haven't been already PR-URL: https://github.com/nodejs/node/pull/34160 Reviewed-By: Anna Henningsen --- src/quic/node_quic_session.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/quic/node_quic_session.cc b/src/quic/node_quic_session.cc index 92657f48b2a3c0..1e37643f91a0c9 100644 --- a/src/quic/node_quic_session.cc +++ b/src/quic/node_quic_session.cc @@ -1468,6 +1468,13 @@ QuicSession::~QuicSession() { if (listener_ == listener()) RemoveListener(listener_); + // Stop and free the idle and retransmission timers if they are active. + // In a clean shutdown, using Close(), these will have already been + // stopped, but if Close() was not called and we're being destroyed + // in GC, for instance, we need to make sure they get stopped here. + StopIdleTimer(); + StopRetransmitTimer(); + DebugStats(); }