Skip to content

Commit

Permalink
eclipse-platform#922: Possible NPE in Menu._setVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Singer committed Dec 27, 2023
1 parent 9de2540 commit bb23172
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ void _setVisible (boolean visible) {

// Hold on to window in case it is disposed while the popup is open.
window.retain();
// The menu might get disposed in a NS* call below (#922), so better
// keep a reference to `display` here.
final Display display = this.display;
// NSMenu processes events on its own while the popup is open.
display.sendPreExternalEventDispatchEvent ();
NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), (short)0, 0, 0);
Expand Down

0 comments on commit bb23172

Please sign in to comment.