mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 15:22:55 +08:00
Move to base class for added safety
This commit is contained in:
parent
cd31cff8cd
commit
444f66b0ee
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user