mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 17:53:21 +08:00
Fix event unbind not being unbound correctly
This commit is contained in:
parent
b56eee1927
commit
eb751fa607
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user