1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 14:13:18 +08:00

Fix event unbind not being unbound correctly

This commit is contained in:
Dean Herbert 2018-03-23 15:05:28 +09:00
parent b56eee1927
commit eb751fa607

View File

@ -48,13 +48,15 @@ namespace osu.Game.Skinning
this.source = source;
}
private void onSourceChanged() => SourceChanged?.Invoke();
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
fallbackSource = dependencies.Get<ISkinSource>();
if (fallbackSource != null)
fallbackSource.SourceChanged += () => SourceChanged?.Invoke();
fallbackSource.SourceChanged += onSourceChanged;
dependencies.CacheAs<ISkinSource>(this);
@ -66,7 +68,7 @@ namespace osu.Game.Skinning
base.Dispose(isDisposing);
if (fallbackSource != null)
fallbackSource.SourceChanged -= SourceChanged;
fallbackSource.SourceChanged -= onSourceChanged;
}
}
}