1
0
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:
Bartłomiej Dach 2023-05-03 14:32:13 +02:00 committed by GitHub
commit 0ba31c5709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}
}
}