diff --git a/osu.Framework/Graphics/Containers/CompositeDrawable.cs b/osu.Framework/Graphics/Containers/CompositeDrawable.cs index 8431be8bc3..4bcac66f5a 100644 --- a/osu.Framework/Graphics/Containers/CompositeDrawable.cs +++ b/osu.Framework/Graphics/Containers/CompositeDrawable.cs @@ -262,6 +262,8 @@ protected internal bool RemoveInternal(Drawable drawable) /// protected internal void ClearInternal(bool disposeChildren = true) { + if (internalChildren.Count == 0) return; + foreach (Drawable t in internalChildren) { if (t.IsAlive) diff --git a/osu.Framework/Graphics/Drawable.cs b/osu.Framework/Graphics/Drawable.cs index 800660a7ac..35697748cf 100644 --- a/osu.Framework/Graphics/Drawable.cs +++ b/osu.Framework/Graphics/Drawable.cs @@ -223,8 +223,8 @@ private bool loadComplete() MainThread = Thread.CurrentThread; scheduler?.SetCurrentThread(MainThread); - Invalidate(); loadState = LoadState.Loaded; + Invalidate(); LoadComplete(); OnLoadComplete?.Invoke(this); return true; @@ -1454,7 +1454,7 @@ private Vector2 computeRequiredParentSizeToFit() /// If the invalidate was actually necessary. public virtual bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) { - if (invalidation == Invalidation.None) + if (invalidation == Invalidation.None || !IsLoaded) return false; if (shallPropagate && Parent != null && source != Parent)