Since Layer.Dispose updates LayoutController.LayoutCount,
LayoutController.Dispose should be called after all layers' Dispose are
called in Window.Dispose.
When a layer's LayoutCount is set, it should update its
LayoutController.LayoutCount by the difference between new and current
LayoutCount.
if (window != null)
{
- if (value == 0)
- {
- window.LayoutController.LayoutCount = 0;
- }
- else
- {
- int diff = value - layoutCount;
- window.LayoutController.LayoutCount += diff;
- }
+ int diff = value - layoutCount;
+ window.LayoutController.LayoutCount += diff;
}
layoutCount = value;
}
DisposeBorder();
}
- if (rootLayer != null)
- {
- rootLayer.Dispose();
- }
-
- localController?.Dispose();
-
foreach (var layer in childLayers)
{
if (layer != null)
}
childLayers.Clear();
+
+ localController?.Dispose();
}
this.DisconnectNativeSignals();