Browse Source

Canvas leak?

Nikita Tsukanov 6 years ago
parent
commit
b0111a2c48
1 changed files with 2 additions and 0 deletions
  1. 2 0
      tests/Avalonia.LeakTests/ControlTests.cs

+ 2 - 0
tests/Avalonia.LeakTests/ControlTests.cs

@@ -75,6 +75,7 @@ namespace Avalonia.LeakTests
                             Name = "foo"
                         }.RegisterInNameScope(scope)
                     };
+                    NameScope.SetNameScope(window, scope);
 
                     window.Show();
 
@@ -85,6 +86,7 @@ namespace Avalonia.LeakTests
 
                     // Clear the content and ensure the Canvas is removed.
                     window.Content = null;
+                    NameScope.SetNameScope(window, null);
 
                     window.LayoutManager.ExecuteLayoutPass();
                     Assert.Null(window.Presenter.Child);