1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 23:42:54 +08:00

Fix score being cloned in async method causing random errors (again)

Compare: https://github.com/ppy/osu/pull/24548.

I don't have a reproduction scenario (judging from the stack trace
of the crash it's likely to be nigh-impossible to concoct a reliable
one), but there is some circumstantial evidence that this might help,
namely that that previous fix above worked, and the pathway that's
failing here is similarly async to the one that pull fixed. So I'm just
gonna start with that and hope that it does the job.
This commit is contained in:
Bartłomiej Dach 2024-09-23 09:49:25 +02:00
parent ccf1acce56
commit 881c9dfbba
No known key found for this signature in database

View File

@ -234,9 +234,12 @@ namespace osu.Game.Screens.Play
{
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();
}