mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Move binding to LoadComplete
Previously there was a chance that it would still never get disposed, as the event was bound in async load, before it was in a state it can be recursively disposed via the PlayerLoader call.
This commit is contained in:
parent
092ba4833e
commit
256baf6d60
@ -55,14 +55,19 @@ namespace osu.Game.Skinning
|
|||||||
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)
|
|
||||||
fallbackSource.SourceChanged += onSourceChanged;
|
|
||||||
|
|
||||||
dependencies.CacheAs<ISkinSource>(this);
|
dependencies.CacheAs<ISkinSource>(this);
|
||||||
|
|
||||||
return dependencies;
|
return dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (fallbackSource != null)
|
||||||
|
fallbackSource.SourceChanged += onSourceChanged;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
Loading…
Reference in New Issue
Block a user