mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:03:08 +08:00
Fix score being cloned in async method causing random crashes
Closes https://github.com/ppy/osu/issues/24445.
This commit is contained in:
parent
526a145b93
commit
e8bde6504a
@ -810,10 +810,13 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!canShowResults && !forceImport)
|
if (!canShowResults && !forceImport)
|
||||||
return Task.FromResult<ScoreInfo>(null);
|
return Task.FromResult<ScoreInfo>(null);
|
||||||
|
|
||||||
|
// Clone score before beginning any async processing.
|
||||||
|
// - Must be run synchronously as the score may potentially be mutated in the background.
|
||||||
|
// - Must be cloned for the same reason.
|
||||||
|
Score scoreCopy = Score.DeepClone();
|
||||||
|
|
||||||
return prepareScoreForDisplayTask = Task.Run(async () =>
|
return prepareScoreForDisplayTask = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var scoreCopy = Score.DeepClone();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await PrepareScoreForResultsAsync(scoreCopy).ConfigureAwait(false);
|
await PrepareScoreForResultsAsync(scoreCopy).ConfigureAwait(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user