From 4b43333ce9a1f3622d675dd17906bfcda8985f7c Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Thu, 25 Dec 2025 22:19:35 -0800 Subject: [PATCH] fix data race between save timer and client disconnect --- src/Client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.cc b/src/Client.cc index e9e650ac..2b5a34a0 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -259,7 +259,7 @@ void Client::reschedule_save_game_data_timer() { this->save_game_data_timer.expires_after(std::chrono::seconds(60)); this->save_game_data_timer.async_wait([this](std::error_code ec) { if (!ec) { - if (this->character_file(false)) { + if (this->login && this->character_file(false)) { this->save_all(); } this->reschedule_save_game_data_timer();