[ntcore] Don't leak buffers in rare WS shutdown case (#5046)

If the request called the callback after the WebSocket had been
destroyed, the buffers were leaked.
This commit is contained in:
Peter Johnson
2023-02-03 21:56:35 -08:00
committed by GitHub
parent b61ac6db33
commit b7535252c2

View File

@@ -50,6 +50,10 @@ void WebSocketConnection::Flush() {
if (self->m_sendsActive > 0) {
--self->m_sendsActive;
}
} else {
for (auto&& buf : bufs) {
buf.Deallocate();
}
}
});
m_frames.clear();