From 3d81799cb5032dfbcdfc9ee39585cf6c6e82c11c Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Mon, 2 Dec 2024 12:58:17 -0300 Subject: [PATCH] fix: login crash --- src/server/network/connection/connection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/network/connection/connection.cpp b/src/server/network/connection/connection.cpp index 96af21885cc..89da0303718 100644 --- a/src/server/network/connection/connection.cpp +++ b/src/server/network/connection/connection.cpp @@ -105,7 +105,8 @@ void Connection::closeSocket() { void Connection::accept(Protocol_ptr protocolPtr) { connectionState = CONNECTION_STATE_IDENTIFYING; - g_dispatcher().addEvent([protocol = std::move(protocolPtr)] { protocol->sendLoginChallenge(); }, __FUNCTION__, std::chrono::milliseconds(CONNECTION_WRITE_TIMEOUT * 1000).count()); + protocol = std::move(protocolPtr); + g_dispatcher().addEvent([eventProtocol = protocol] { eventProtocol->sendLoginChallenge(); }, __FUNCTION__, std::chrono::milliseconds(CONNECTION_WRITE_TIMEOUT * 1000).count()); acceptInternal(false); }