1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 04:33:21 +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> /// <summary>
/// Unregisters a blocking <see cref="OverlayContainer"/> that was not created by <see cref="OsuGame"/> itself. /// Unregisters a blocking <see cref="OverlayContainer"/> that was not created by <see cref="OsuGame"/> itself.
/// </summary> /// </summary>
private void unregisterBlockingOverlay(OverlayContainer overlayContainer) private void unregisterBlockingOverlay(OverlayContainer overlayContainer) => Schedule(() =>
{ {
externalOverlays.Remove(overlayContainer); externalOverlays.Remove(overlayContainer);
@ -239,7 +239,7 @@ namespace osu.Game
focusedOverlays.Remove(focusedOverlayContainer); focusedOverlays.Remove(focusedOverlayContainer);
overlayContainer.Expire(); overlayContainer.Expire();
} });
#endregion #endregion