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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
2 deletions
-
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) |
|
|
|
|