Browse Source

Merge pull request #7373 from AvaloniaUI/fix-nre-menu-close

Fix NRE on window close with opened menu
repro/minimal-repro-stackoverflow-onewaytosource-binding
Tako 4 years ago
committed by Max Katz
parent
commit
54167cf3ac
  1. 2
      src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs

2
src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs

@ -101,7 +101,7 @@ namespace Avalonia.Controls.Platform
root.Deactivated -= WindowDeactivated;
}
if (_root is TopLevel tl)
if (_root is TopLevel tl && tl.PlatformImpl != null)
tl.PlatformImpl.LostFocus -= TopLevelLostPlatformFocus;
_inputManagerSubscription?.Dispose();

Loading…
Cancel
Save