From b5f7d5894b3f247108141e066ce656f262c74c88 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 20 Aug 2021 11:42:17 +0200 Subject: [PATCH] dnsdist: Catch FDMultiplexerException in IOStateHandler's destructor --- pdns/dnsdistdist/tcpiohandler-mplexer.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdistdist/tcpiohandler-mplexer.hh b/pdns/dnsdistdist/tcpiohandler-mplexer.hh index c7d0c26e09..a241967326 100644 --- a/pdns/dnsdistdist/tcpiohandler-mplexer.hh +++ b/pdns/dnsdistdist/tcpiohandler-mplexer.hh @@ -27,7 +27,13 @@ public: /* be careful that this won't save us if the callback is still registered to the multiplexer, because in that case the shared pointer count will never reach zero so this destructor won't be called */ - reset(); + try { + reset(); + } + catch (const FDMultiplexerException& e) { + /* that should not happen, but an exception raised from a destructor would be bad so better + safe than sorry */ + } } IOState getState() const -- 2.47.2