mirror of https://github.com/ppy/osu
Add null check guards to unsubscriptions in `Dispose()`
This commit is contained in:
parent
04db80848b
commit
71c0216c55
|
@ -133,7 +133,9 @@ private void skinSourceChanged()
|
|||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
skin.SourceChanged -= skinSourceChanged;
|
||||
|
||||
if (skin != null)
|
||||
skin.SourceChanged -= skinSourceChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,7 +110,9 @@ private void load(TextureStore textureStore, Storyboard storyboard)
|
|||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
skin.SourceChanged -= skinSourceChanged;
|
||||
|
||||
if (skin != null)
|
||||
skin.SourceChanged -= skinSourceChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue