Fix stackoverflow

This commit is contained in:
smoogipoo 2020-09-02 21:52:56 +09:00
parent 5ebead2bfd
commit 02a908752f

View File

@ -224,7 +224,6 @@ namespace osu.Game.Screens.Select
{ {
base.LoadComplete(); base.LoadComplete();
beatmaps.CollectionChanged += filterBeatmapsChanged;
Current.BindValueChanged(filterChanged, true); Current.BindValueChanged(filterChanged, true);
} }
@ -247,11 +246,15 @@ namespace osu.Game.Screens.Select
/// </summary> /// </summary>
private void filterChanged(ValueChangedEvent<CollectionFilter> filter) private void filterChanged(ValueChangedEvent<CollectionFilter> filter)
{ {
beatmaps.CollectionChanged -= filterBeatmapsChanged;
if (filter.OldValue?.Collection != null) if (filter.OldValue?.Collection != null)
beatmaps.UnbindFrom(filter.OldValue.Collection.Beatmaps); beatmaps.UnbindFrom(filter.OldValue.Collection.Beatmaps);
if (filter.NewValue?.Collection != null) if (filter.NewValue?.Collection != null)
beatmaps.BindTo(filter.NewValue.Collection.Beatmaps); beatmaps.BindTo(filter.NewValue.Collection.Beatmaps);
beatmaps.CollectionChanged += filterBeatmapsChanged;
} }
/// <summary> /// <summary>