1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Improve safety of FileChooserLabelledTextBox disposal

This commit is contained in:
Bartłomiej Dach 2022-06-02 20:38:14 +02:00
parent ec24b32fa6
commit cf9b78ea2a
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -11,6 +11,7 @@ using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
@ -67,7 +68,9 @@ namespace osu.Game.Screens.Edit.Setup
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
game.UnregisterImportHandler(this);
if (game.IsNotNull())
game.UnregisterImportHandler(this);
}
public override Popover GetPopover() => new FileChooserPopover(handledExtensions, currentFile);