From eb751fa607d25c187947cb53bd4d7988f8824114 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 23 Mar 2018 15:05:28 +0900 Subject: [PATCH] Fix event unbind not being unbound correctly --- osu.Game/Skinning/LocalSkinOverrideContainer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index b7e2bd0daf..d000127859 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -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(); if (fallbackSource != null) - fallbackSource.SourceChanged += () => SourceChanged?.Invoke(); + fallbackSource.SourceChanged += onSourceChanged; dependencies.CacheAs(this); @@ -66,7 +68,7 @@ namespace osu.Game.Skinning base.Dispose(isDisposing); if (fallbackSource != null) - fallbackSource.SourceChanged -= SourceChanged; + fallbackSource.SourceChanged -= onSourceChanged; } } }