mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix event unbind not being unbound correctly
This commit is contained in:
@ -48,13 +48,15 @@ namespace osu.Game.Skinning
|
|||||||
this.source = source;
|
this.source = source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onSourceChanged() => SourceChanged?.Invoke();
|
||||||
|
|
||||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
|
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
|
||||||
{
|
{
|
||||||
var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
||||||
|
|
||||||
fallbackSource = dependencies.Get<ISkinSource>();
|
fallbackSource = dependencies.Get<ISkinSource>();
|
||||||
if (fallbackSource != null)
|
if (fallbackSource != null)
|
||||||
fallbackSource.SourceChanged += () => SourceChanged?.Invoke();
|
fallbackSource.SourceChanged += onSourceChanged;
|
||||||
|
|
||||||
dependencies.CacheAs<ISkinSource>(this);
|
dependencies.CacheAs<ISkinSource>(this);
|
||||||
|
|
||||||
@ -66,7 +68,7 @@ namespace osu.Game.Skinning
|
|||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
if (fallbackSource != null)
|
if (fallbackSource != null)
|
||||||
fallbackSource.SourceChanged -= SourceChanged;
|
fallbackSource.SourceChanged -= onSourceChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user