Merge pull request #3298 from smoogipoo/fix-canceledexception

Fix operation cancelled exception when changing visual settings
This commit is contained in:
Dean Herbert 2018-08-23 23:02:22 +09:00 committed by GitHub
commit dc8bcb2a18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -85,12 +85,10 @@ namespace osu.Game.Skinning
private void load(OsuConfigManager config)
{
beatmapSkins = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapSkins.ValueChanged += val => onSourceChanged();
beatmapSkins.TriggerChange();
beatmapSkins.BindValueChanged(_ => onSourceChanged());
beatmapHitsounds = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
beatmapHitsounds.ValueChanged += val => onSourceChanged();
beatmapHitsounds.TriggerChange();
beatmapHitsounds.BindValueChanged(_ => onSourceChanged(), true);
}
protected override void LoadComplete()

View File

@ -52,5 +52,13 @@ namespace osu.Game.Skinning
protected virtual void SkinChanged(ISkinSource skin, bool allowFallback)
{
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
if (skin != null)
skin.SourceChanged -= onChange;
}
}
}