mirror of https://github.com/ppy/osu
Fix potential double-disposal of player if PlayerLoader is finalised
This commit is contained in:
parent
54e53f7190
commit
5872b61988
|
@ -209,8 +209,11 @@ protected override void Dispose(bool isDisposing)
|
|||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
// if the player never got pushed, we should explicitly dispose it.
|
||||
loadTask?.ContinueWith(_ => player.Dispose());
|
||||
if (isDisposing)
|
||||
{
|
||||
// if the player never got pushed, we should explicitly dispose it.
|
||||
loadTask?.ContinueWith(_ => player.Dispose());
|
||||
}
|
||||
}
|
||||
|
||||
private class BeatmapMetadataDisplay : Container
|
||||
|
|
Loading…
Reference in New Issue