Fix potential double-disposal of player if PlayerLoader is finalised

This commit is contained in:
Dean Herbert 2018-05-30 15:47:31 +09:00
parent 54e53f7190
commit 5872b61988
1 changed files with 5 additions and 2 deletions

View File

@ -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