1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Merge pull request #2379 from peppy/fix-crash-regression

Fix regression causing hard crash
This commit is contained in:
Thomas Müller 2018-04-11 13:08:32 +02:00 committed by GitHub
commit 62968bb4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,15 +51,17 @@ namespace osu.Game.Overlays.Settings.Sections
},
};
skins.ItemAdded += reloadSkins;
skins.ItemRemoved += reloadSkins;
skins.ItemAdded += onItemsChanged;
skins.ItemRemoved += onItemsChanged;
reloadSkins(null);
reloadSkins();
skinDropdown.Bindable = config.GetBindable<int>(OsuSetting.Skin);
}
private void reloadSkins(SkinInfo changed) => Schedule(() => skinDropdown.Items = skins.GetAllUsableSkins().Select(s => new KeyValuePair<string, int>(s.ToString(), s.ID)));
private void reloadSkins() => skinDropdown.Items = skins.GetAllUsableSkins().Select(s => new KeyValuePair<string, int>(s.ToString(), s.ID));
private void onItemsChanged(SkinInfo _) => Schedule(reloadSkins);
protected override void Dispose(bool isDisposing)
{
@ -67,8 +69,8 @@ namespace osu.Game.Overlays.Settings.Sections
if (skins != null)
{
skins.ItemAdded -= reloadSkins;
skins.ItemRemoved -= reloadSkins;
skins.ItemAdded -= onItemsChanged;
skins.ItemRemoved -= onItemsChanged;
}
}