Fix event subscriptions not being cleaned up in DrawableCarouselBeatmap

The handling of cleanup is performed only the `Item_Set` method. This
was already correctly called for `DrawableCarouselBeatmapSet`, but not
for the class in question here.

This would cause runaway memory usage at song select when opening many
beatmaps to show their difficulties. For simplicity, we don't yet pool
these (and generate the drawables each time a set is opened) which isn't
great but likely will be improved upon when we update the visual /
filtering of the carousel. But this simplicity caused the memory usage
to blow out until exiting back to the main menu when cleanup would
finally occur.
This commit is contained in:
Dean Herbert
2023-05-03 18:41:29 +09:00
parent 88135a3be8
commit cd31cff8cd

View File

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