1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Hold a bound copy reference instead

This commit is contained in:
Salman Ahmed 2021-07-02 23:24:51 +03:00
parent 612ed6353c
commit 83578e7c9d

View File

@ -30,14 +30,8 @@ namespace osu.Game.Overlays
get => current;
set
{
if (current != null)
{
current.ValueChanged -= onValueChanged;
current.DefaultChanged -= onDefaultChanged;
current.DisabledChanged -= onDisabledChanged;
}
current = value;
current?.UnbindAll();
current = value.GetBoundCopy();
current.ValueChanged += onValueChanged;
current.DefaultChanged += onDefaultChanged;