Browse Source
Merge pull request #3282 from MarchingCube/fix-window-close-memory-leak
Fix memory leak caused by styles staying applied after window close
pull/3297/head
Dariusz Komosiński
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
0 deletions
-
src/Avalonia.Controls/TopLevel.cs
|
|
|
@ -269,6 +269,12 @@ namespace Avalonia.Controls |
|
|
|
/// </summary>
|
|
|
|
protected virtual void HandleClosed() |
|
|
|
{ |
|
|
|
var logicalArgs = new LogicalTreeAttachmentEventArgs(this); |
|
|
|
((ILogical)this).NotifyDetachedFromLogicalTree(logicalArgs); |
|
|
|
|
|
|
|
var visualArgs = new VisualTreeAttachmentEventArgs(this, this); |
|
|
|
OnDetachedFromVisualTreeCore(visualArgs); |
|
|
|
|
|
|
|
(this as IInputRoot).MouseDevice?.TopLevelClosed(this); |
|
|
|
PlatformImpl = null; |
|
|
|
OnClosed(EventArgs.Empty); |
|
|
|
|