1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:03:08 +08:00

Move to base class for added safety

This commit is contained in:
Dean Herbert 2023-05-03 18:45:09 +09:00
parent cd31cff8cd
commit 444f66b0ee
2 changed files with 9 additions and 4 deletions

View File

@ -250,9 +250,6 @@ namespace osu.Game.Screens.Select.Carousel
{
base.Dispose(isDisposing);
starDifficultyCancellationSource?.Cancel();
// This is important to clean up event subscriptions.
Item = null;
}
}
}

View File

@ -58,7 +58,7 @@ namespace osu.Game.Screens.Select.Carousel
item = value;
if (IsLoaded)
if (IsLoaded && !IsDisposed)
UpdateItem();
}
}
@ -165,5 +165,13 @@ namespace osu.Game.Screens.Select.Carousel
Item.State.Value = CarouselItemState.Selected;
return true;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
// This is important to clean up event subscriptions.
Item = null;
}
}
}