1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:02:55 +08:00

Merge pull request #18906 from peppy/fix-collection-modified-close-all-overlays

Fix potential crash on `CloseAllOverlays` due to collection mutation
This commit is contained in:
Bartłomiej Dach 2022-06-27 19:10:49 +02:00 committed by GitHub
commit 8051a5a192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,7 +231,7 @@ namespace osu.Game
/// <summary>
/// Unregisters a blocking <see cref="OverlayContainer"/> that was not created by <see cref="OsuGame"/> itself.
/// </summary>
private void unregisterBlockingOverlay(OverlayContainer overlayContainer)
private void unregisterBlockingOverlay(OverlayContainer overlayContainer) => Schedule(() =>
{
externalOverlays.Remove(overlayContainer);
@ -239,7 +239,7 @@ namespace osu.Game
focusedOverlays.Remove(focusedOverlayContainer);
overlayContainer.Expire();
}
});
#endregion