1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 10:22:56 +08:00

Ensure drawable channels removed from the cache are disposed

This commit is contained in:
Jai Sharma 2022-05-14 00:15:02 +01:00
parent f88e416d1a
commit 2163a78b7f

View File

@ -241,6 +241,7 @@ namespace osu.Game.Overlays
if (newChannel == null)
{
// null channel denotes that we should be showing the listing.
currentChannelContainer.Clear(false);
channelListing.State.Value = Visibility.Visible;
textBar.ShowSearch.Value = true;
}
@ -298,7 +299,13 @@ namespace osu.Game.Overlays
foreach (var channel in leftChannels)
{
channelList.RemoveChannel(channel);
loadedChannels.Remove(channel);
if (loadedChannels.ContainsKey(channel))
{
ChatOverlayDrawableChannel loaded = loadedChannels[channel];
loadedChannels.Remove(channel);
// DrawableChannel removed from cache must be manually disposed
loaded.Dispose();
}
}
break;