mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 01:59:53 +08:00
Fix potential test deadlock
Disposal woes.
This commit is contained in:
+7
-1
@@ -227,6 +227,8 @@ namespace osu.Game
|
||||
|
||||
private Bindable<string> configSkin;
|
||||
|
||||
private RealmDetachedBeatmapStore detachedBeatmapStore;
|
||||
|
||||
private readonly string[] args;
|
||||
|
||||
private readonly List<OsuFocusedOverlayContainer> focusedOverlays = new List<OsuFocusedOverlayContainer>();
|
||||
@@ -1002,6 +1004,10 @@ namespace osu.Game
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
// Without this, tests may deadlock due to cancellation token not becoming cancelled before disposal.
|
||||
// To reproduce, run `TestSceneButtonSystemNavigation` ensuring `TestConstructor` runs before `TestFastShortcutKeys`.
|
||||
detachedBeatmapStore?.Dispose();
|
||||
|
||||
base.Dispose(isDisposing);
|
||||
SentryLogger.Dispose();
|
||||
}
|
||||
@@ -1245,7 +1251,7 @@ namespace osu.Game
|
||||
loadComponentSingleFile(new MedalOverlay(), topMostOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(new BackgroundDataStoreProcessor(), Add);
|
||||
loadComponentSingleFile<BeatmapStore>(new RealmDetachedBeatmapStore(), Add, true);
|
||||
loadComponentSingleFile<BeatmapStore>(detachedBeatmapStore = new RealmDetachedBeatmapStore(), Add, true);
|
||||
|
||||
Add(externalLinkOpener = new ExternalLinkOpener());
|
||||
Add(new MusicKeyBindingHandler());
|
||||
|
||||
Reference in New Issue
Block a user