fix: address re-entrancy in ReplaceChild and invalid split in AddDocument

This commit is contained in:
2026-03-28 22:48:58 +09:00
parent 0f0b36a932
commit 45711e7770
2 changed files with 2 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ public abstract class DockContainer : DockModule
throw new ArgumentException("newChild is already in this container", nameof(newChild)); throw new ArgumentException("newChild is already in this container", nameof(newChild));
} }
newChild.Owner?.RemoveChild(newChild); newChild.Owner?.RemoveChildInternal(newChild, false);
// Remove oldChild without triggering cleanup // Remove oldChild without triggering cleanup
_isCleaningUp = true; _isCleaningUp = true;

View File

@@ -100,7 +100,7 @@ public class DockingLayout : Control
} }
} }
if (target == DockTarget.Center) if (target == DockTarget.Center || targetGroup.Children.Count == 0)
{ {
targetGroup.AddChild(document); targetGroup.AddChild(document);
} }