Skip to content

Commit

Permalink
Merge pull request #29966 from bdach/unsafe-deep-clone
Browse files Browse the repository at this point in the history
Fix score being cloned in async method causing random errors (again)
  • Loading branch information
peppy authored Sep 23, 2024
2 parents 31e4230 + 881c9df commit f08134f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion osu.Game/Screens/Play/SubmittingPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,12 @@ private void submitFromFailOrQuit()
{
if (LoadedBeatmapSuccessfully)
{
// compare: https://github.com/ppy/osu/blob/ccf1acce56798497edfaf92d3ece933469edcf0a/osu.Game/Screens/Play/Player.cs#L848-L851
var scoreCopy = Score.DeepClone();

Task.Run(async () =>
{
await submitScore(Score.DeepClone()).ConfigureAwait(false);
await submitScore(scoreCopy).ConfigureAwait(false);
spectatorClient.EndPlaying(GameplayState);
}).FireAndForget();
}
Expand Down

0 comments on commit f08134f

Please sign in to comment.