Browse Source

Clean up EffectiveViewportChanged earlier.

Clean up the `EffectiveViewportChanged` subscriptions before calling `OnDetachedFromVisualTree` so that (un)subscribing to the `EffectiveViewportChanged`  event in `OnDetachedFromVisualTree` doesn't cause a leak.
pull/4626/head
Steven Kirk 6 years ago
parent
commit
60c0a44a87
  1. 4
      src/Avalonia.Layout/Layoutable.cs

4
src/Avalonia.Layout/Layoutable.cs

@ -758,8 +758,6 @@ namespace Avalonia.Layout
protected override void OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
{
base.OnDetachedFromVisualTreeCore(e);
if (e.Root is ILayoutRoot r)
{
if (_layoutUpdated is object)
@ -772,6 +770,8 @@ namespace Avalonia.Layout
r.LayoutManager.UnregisterEffectiveViewportListener(this);
}
}
base.OnDetachedFromVisualTreeCore(e);
}
/// <summary>

Loading…
Cancel
Save