1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Fix playlist settings reference leak due to unsafe callback binding

This commit is contained in:
Salman Ahmed 2022-08-01 20:08:18 +03:00
parent 01cc9bd7ef
commit c851e3d8f3

View File

@ -78,6 +78,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
[Resolved]
private IAPIProvider api { get; set; }
private IBindable<APIUser> localUser;
private readonly Room room;
public MatchSettings(Room room)
@ -304,7 +306,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
MaxAttempts.BindValueChanged(count => MaxAttemptsField.Text = count.NewValue?.ToString(), true);
Duration.BindValueChanged(duration => DurationField.Current.Value = duration.NewValue ?? TimeSpan.FromMinutes(30), true);
api.LocalUser.BindValueChanged(populateDurations, true);
localUser = api.LocalUser.GetBoundCopy();
localUser.BindValueChanged(populateDurations, true);
playlist.Items.BindTo(Playlist);
Playlist.BindCollectionChanged(onPlaylistChanged, true);