mirror of
https://github.com/ppy/osu
synced 2025-03-11 05:49:12 +00:00
Merge pull request #27021 from frenzibyte/fix-rooms-container-performance
Fix multiplayer/playlists lounge screen disposing rooms synchronously
This commit is contained in:
commit
462a1c5186
@ -126,7 +126,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
Debug.Assert(args.OldItems != null);
|
||||
|
||||
removeRooms(args.OldItems.Cast<Room>());
|
||||
// clear operations have a separate path that benefits from async disposal,
|
||||
// since disposing is quite expensive when performed on a high number of drawables synchronously.
|
||||
if (args.OldItems.Count == roomFlow.Count)
|
||||
clearRooms();
|
||||
else
|
||||
removeRooms(args.OldItems.Cast<Room>());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -151,6 +157,15 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
}
|
||||
}
|
||||
|
||||
private void clearRooms()
|
||||
{
|
||||
roomFlow.Clear();
|
||||
|
||||
// selection may have a lease due to being in a sub screen.
|
||||
if (!SelectedRoom.Disabled)
|
||||
SelectedRoom.Value = null;
|
||||
}
|
||||
|
||||
private void updateSorting()
|
||||
{
|
||||
foreach (var room in roomFlow)
|
||||
|
Loading…
Reference in New Issue
Block a user