1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 02:53:21 +08:00

Attempt to fix test failures

This commit is contained in:
Bartłomiej Dach 2024-11-28 10:24:56 +01:00
parent bf29e3ae71
commit b0958c8d41
No known key found for this signature in database

View File

@ -144,10 +144,12 @@ namespace osu.Game.Overlays
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
// this event subscription fires async loads, which hard-fail if `CompositeDrawable.disposalCancellationSource` is canceled, which happens in the base call.
// therefore, unsubscribe from this event early to reduce the chances of a stray event firing at an inconvenient spot.
if (api.IsNotNull())
api.NotificationsClient.MessageReceived -= handleMedalMessages;
base.Dispose(isDisposing);
}
}
}