mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 19:32:55 +08:00
Clean up DrawableHitObject
events on Dispose
This is just general safeties to avoid cases where components don't correctly unbind events.
This commit is contained in:
parent
9c55498058
commit
de32e7815b
@ -768,6 +768,13 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
|
||||
if (CurrentSkin != null)
|
||||
CurrentSkin.SourceChanged -= skinSourceChanged;
|
||||
|
||||
// Safeties against shooting in foot in cases where these are bound by external entities (like playfield) that don't clean up.
|
||||
OnNestedDrawableCreated = null;
|
||||
OnNewResult = null;
|
||||
OnRevertResult = null;
|
||||
DefaultsApplied = null;
|
||||
HitObjectApplied = null;
|
||||
}
|
||||
|
||||
public Bindable<double> AnimationStartTime { get; } = new BindableDouble();
|
||||
|
@ -38,6 +38,8 @@ namespace osu.Game.Rulesets.Objects
|
||||
/// <summary>
|
||||
/// Invoked after <see cref="ApplyDefaults"/> has completed on this <see cref="HitObject"/>.
|
||||
/// </summary>
|
||||
// TODO: This has no implicit unbind flow. Currently, if a Playfield manages HitObjects it will leave a bound event on this and cause the
|
||||
// playfield to remain in memory.
|
||||
public event Action<HitObject> DefaultsApplied;
|
||||
|
||||
public readonly Bindable<double> StartTimeBindable = new BindableDouble();
|
||||
|
Loading…
Reference in New Issue
Block a user