mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:53:21 +08:00
Fix skin changed events triggering after disposal
This commit is contained in:
parent
ae66a7e9e4
commit
a290437286
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -36,12 +36,14 @@ namespace osu.Game.Skinning
|
|||||||
skin.SourceChanged += onChange;
|
skin.SourceChanged += onChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onChange() => SkinChanged(skin, allowDefaultFallback);
|
private void onChange() =>
|
||||||
|
// schedule required to avoid calls after disposed.
|
||||||
|
Schedule(() => SkinChanged(skin, allowDefaultFallback));
|
||||||
|
|
||||||
protected override void LoadAsyncComplete()
|
protected override void LoadAsyncComplete()
|
||||||
{
|
{
|
||||||
base.LoadAsyncComplete();
|
base.LoadAsyncComplete();
|
||||||
onChange();
|
SkinChanged(skin, allowDefaultFallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user