diff --git a/src/web/impl/WsBase.h b/src/web/impl/WsBase.h index e1e51d857..ded75086a 100644 --- a/src/web/impl/WsBase.h +++ b/src/web/impl/WsBase.h @@ -121,6 +121,10 @@ public: void maybeSendNext() { + // cleanup if needed. can't do this in destructor so it's here + if (dead()) + (*handler_)(ec_, derived().shared_from_this()); + if (ec_ || sending_ || messages_.empty()) return;