mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 04:02:59 +08:00
Merge pull request #23388 from peppy/fix-song-select-drawable-carousel-beatmap-leak
Fix runaway memory usage at song select when opening many beatmaps many times
This commit is contained in:
commit
0ba31c5709
@ -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