Browse Source

Prevent reentrancy in ExecuteInitialLayoutPass.

Fixes #3550.
pull/3553/head
Steven Kirk 7 years ago
parent
commit
d5fc004df0
  1. 12
      src/Avalonia.Layout/LayoutManager.cs

12
src/Avalonia.Layout/LayoutManager.cs

@ -132,8 +132,16 @@ namespace Avalonia.Layout
/// <inheritdoc/> /// <inheritdoc/>
public void ExecuteInitialLayoutPass(ILayoutRoot root) public void ExecuteInitialLayoutPass(ILayoutRoot root)
{ {
Measure(root); try
Arrange(root); {
_running = true;
Measure(root);
Arrange(root);
}
finally
{
_running = false;
}
// Running the initial layout pass may have caused some control to be invalidated // Running the initial layout pass may have caused some control to be invalidated
// so run a full layout pass now (this usually due to scrollbars; its not known // so run a full layout pass now (this usually due to scrollbars; its not known

Loading…
Cancel
Save