mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Merge pull request #14948 from peppy/fix-drawable-channel-ci-failures
Ensure a `DrawableChannel` is not attempted to be added after disposal
This commit is contained in:
@ -284,6 +284,10 @@ namespace osu.Game.Overlays
|
||||
if (currentChannel.Value != e.NewValue)
|
||||
return;
|
||||
|
||||
// check once more to ensure the channel hasn't since been removed from the loaded channels list (may have been left by some automated means).
|
||||
if (loadedChannels.Contains(loaded))
|
||||
return;
|
||||
|
||||
loading.Hide();
|
||||
|
||||
currentChannelContainer.Clear(false);
|
||||
@ -444,10 +448,9 @@ namespace osu.Game.Overlays
|
||||
|
||||
if (loaded != null)
|
||||
{
|
||||
loadedChannels.Remove(loaded);
|
||||
|
||||
// Because the container is only cleared in the async load callback of a new channel, it is forcefully cleared
|
||||
// to ensure that the previous channel doesn't get updated after it's disposed
|
||||
loadedChannels.Remove(loaded);
|
||||
currentChannelContainer.Remove(loaded);
|
||||
loaded.Dispose();
|
||||
}
|
||||
|
Reference in New Issue
Block a user