don't allow *this to be destroyed too early on idle timeout

This commit is contained in:
Martin Michelsen
2023-09-19 23:40:31 -07:00
parent 64bbeb0f70
commit 3d0a842496
+2 -1
View File
@@ -245,7 +245,8 @@ void Client::idle_timeout() {
this->log.info("Idle timeout expired");
auto s = this->server.lock();
if (s) {
s->disconnect_client(this->shared_from_this());
auto c = this->shared_from_this();
s->disconnect_client(c);
} else {
this->log.info("Server is deleted; cannot disconnect client");
}