Skip to content

Commit

Permalink
Always cancel drain timeout in QuicTransportBase destructor
Browse files Browse the repository at this point in the history
Summary: This is basically as a safeguard, to ensure that the drain timeout doesn't try to keep running after the destruction of the transport.

Reviewed By: jbeshay

Differential Revision: D52267494

fbshipit-source-id: d9ba99e499de7d01281b56bec40298f4e52e6fca
  • Loading branch information
Matt Joras authored and facebook-github-bot committed Dec 19, 2023
1 parent 4c84710 commit 3ba2147
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions quic/api/QuicTransportBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ const folly::SocketAddress& QuicTransportBase::getLocalAddress() const {

QuicTransportBase::~QuicTransportBase() {
resetConnectionCallbacks();
// Just in case this ended up hanging around.
cancelTimeout(&drainTimeout_);

// closeImpl and closeUdpSocket should have been triggered by destructor of
// derived class to ensure that observers are properly notified
Expand Down

0 comments on commit 3ba2147

Please sign in to comment.