From e15a91911efec7678a28349bd6b9d360c347ff5e Mon Sep 17 00:00:00 2001 From: Zwelf Date: Fri, 4 Dec 2020 10:53:28 +0100 Subject: [PATCH] Fix storing load/save result in main thread without incrementing usage count Resulting to race condition, since the main thread always thought that the load/save thread already completed. Passing the shared_ptr by reference to prevent a similar future bug to happen. Fixes #3380 --- src/game/server/teams.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/server/teams.h b/src/game/server/teams.h index f2f446707..8f2c12211 100644 --- a/src/game/server/teams.h +++ b/src/game/server/teams.h @@ -123,9 +123,9 @@ public: m_TeeFinished[ClientID] = finished; } - void SetSaving(int TeamID, std::shared_ptr SaveResult) + void SetSaving(int TeamID, std::shared_ptr &SaveResult) { - m_pSaveTeamResult[TeamID] = std::move(SaveResult); + m_pSaveTeamResult[TeamID] = SaveResult; } bool GetSaving(int TeamID)