Skip to content

Commit

Permalink
Still working on the test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpeppers committed Feb 22, 2023
1 parent 53c00b0 commit 2ac2129
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Controls/tests/DeviceTests/Elements/Window/WindowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,16 @@ public async Task WindowsDoNotLeak()
await CreateHandlerAndAddToWindow<WindowHandlerStub>(window, _ =>
{
new Application().OpenWindow(window);
((IWindow)window).Destroying();
});

window = null;
await Task.Yield();
GC.Collect();
GC.WaitForPendingFinalizers();
await Task.Yield();
GC.Collect();
GC.WaitForPendingFinalizers();

Assert.False(windowReference.IsAlive, "Window wasn't collected");
}
Expand Down

0 comments on commit 2ac2129

Please sign in to comment.