Browse Source
dispose layout manager when embeddable control root is disposed. (#14341)
pull/14354/head
Emmanuel Hansen
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
14 additions and
2 deletions
-
src/Android/Avalonia.Android/AvaloniaView.cs
-
src/Android/Avalonia.Android/SingleViewLifetime.cs
-
src/Avalonia.Controls/Embedding/EmbeddableControlRoot.cs
|
|
|
@ -42,6 +42,13 @@ namespace Avalonia.Android |
|
|
|
set { _root.Content = value; } |
|
|
|
} |
|
|
|
|
|
|
|
protected override void Dispose(bool disposing) |
|
|
|
{ |
|
|
|
base.Dispose(disposing); |
|
|
|
_root?.Dispose(); |
|
|
|
_root = null; |
|
|
|
} |
|
|
|
|
|
|
|
public override bool DispatchKeyEvent(KeyEvent e) |
|
|
|
{ |
|
|
|
return _view.View.DispatchKeyEvent(e); |
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ namespace Avalonia.Android |
|
|
|
_activity = activity; |
|
|
|
|
|
|
|
if (activity is IAvaloniaActivity activableActivity) |
|
|
|
{ |
|
|
|
{ |
|
|
|
activableActivity.Activated += (_, args) => Activated?.Invoke(this, args); |
|
|
|
activableActivity.Deactivated += (_, args) => Deactivated?.Invoke(this, args); |
|
|
|
} |
|
|
|
|
|
|
|
@ -51,6 +51,11 @@ namespace Avalonia.Controls.Embedding |
|
|
|
} |
|
|
|
|
|
|
|
protected override Type StyleKeyOverride => typeof(EmbeddableControlRoot); |
|
|
|
public void Dispose() => PlatformImpl?.Dispose(); |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
PlatformImpl?.Dispose(); |
|
|
|
LayoutManager?.Dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|