Browse Source

Merge pull request #1371 from jkoritzinsky/refcount-scene

Don't dispose visual nodes replaced with themselves.
pull/1373/head
Steven Kirk 9 years ago
committed by GitHub
parent
commit
6656b10376
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/Avalonia.Visuals/Rendering/SceneGraph/VisualNode.cs

7
src/Avalonia.Visuals/Rendering/SceneGraph/VisualNode.cs

@ -148,7 +148,10 @@ namespace Avalonia.Rendering.SceneGraph
EnsureChildrenCreated();
var old = _children[index];
_children[index] = node;
old.Dispose();
if (node != old)
{
old.Dispose();
}
}
/// <summary>
@ -329,7 +332,7 @@ namespace Avalonia.Rendering.SceneGraph
_drawOperationsCloned = false;
}
}
public void Dispose()
{
foreach (var child in Children)

Loading…
Cancel
Save