1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 01:27:20 +08:00

Fix potential crash from cross-thread drawable manipulation in CollectionFilterDropdown

This commit is contained in:
Dean Herbert 2021-02-18 14:10:28 +09:00
parent e30fb72ee2
commit 90dce52042
2 changed files with 7 additions and 8 deletions

View File

@ -41,19 +41,18 @@ namespace osu.Game.Collections
ItemSource = filters; ItemSource = filters;
} }
[BackgroundDependencyLoader(permitNulls: true)] [Resolved(CanBeNull = true)]
private void load([CanBeNull] CollectionManager collectionManager) private CollectionManager collectionManager { get; set; }
protected override void LoadComplete()
{ {
base.LoadComplete();
if (collectionManager != null) if (collectionManager != null)
collections.BindTo(collectionManager.Collections); collections.BindTo(collectionManager.Collections);
collections.CollectionChanged += (_, __) => collectionsChanged(); collections.CollectionChanged += (_, __) => collectionsChanged();
collectionsChanged(); collectionsChanged();
}
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(filterChanged, true); Current.BindValueChanged(filterChanged, true);
} }

View File

@ -44,7 +44,7 @@ namespace osu.Game.Screens.Select
Sort = sortMode.Value, Sort = sortMode.Value,
AllowConvertedBeatmaps = showConverted.Value, AllowConvertedBeatmaps = showConverted.Value,
Ruleset = ruleset.Value, Ruleset = ruleset.Value,
Collection = collectionDropdown?.Current.Value.Collection Collection = collectionDropdown?.Current.Value?.Collection
}; };
if (!minimumStars.IsDefault) if (!minimumStars.IsDefault)