Browse Source

Propagate Dispose from RenderDataPushNode (#15240)

* Implemented IDisposable for RenderDataCustomNode.

* Propagate Dispose from RenderDataPushNode to all child nodes.
pull/15258/head
nateglasser 2 years ago
committed by GitHub
parent
commit
16ff8cdc8b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/Avalonia.Base/Rendering/Composition/Drawing/Nodes/RenderDataNodes.cs

4
src/Avalonia.Base/Rendering/Composition/Drawing/Nodes/RenderDataNodes.cs

@ -136,8 +136,8 @@ abstract class RenderDataPushNode : IRenderDataItem, IDisposable
if (Children.Count > 0) if (Children.Count > 0)
{ {
foreach(var ch in Children) foreach(var ch in Children)
if (ch is RenderDataPushNode node) if (ch is IDisposable disposable)
node.Dispose(); disposable.Dispose();
Children.Dispose(); Children.Dispose();
} }
} }

Loading…
Cancel
Save