fix data race between save timer and client disconnect

This commit is contained in:
Martin Michelsen
2025-12-25 22:19:35 -08:00
parent b228ea847f
commit 4b43333ce9
+1 -1
View File
@@ -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();