summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-03-18 13:07:55 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-03-18 13:07:55 +0100
commitf89593d0de0e3114b6dd401165f47549b9fd87be (patch)
tree709987b75ae9e1e9c27bb666613bbc1e0043ad8f
parent1acd2e98d6739c48e43c82356a44a0694b5276ed (diff)
Avoid crash when messages canBecomeKeyWindow or canBecomeMainWindow received by closed window.
-rw-r--r--src/Fl_cocoa.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index ada24a1e3..77a326a7c 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -658,7 +658,7 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop()
if (Fl::modal_ && (Fl::modal_ != w))
return NO; // prevent the caption to be redrawn as active on click
// when another modal window is currently the key win
- return !(w->tooltip_window() || w->menu_window() || w->parent());
+ return !(!w || w->tooltip_window() || w->menu_window() || w->parent());
}
- (BOOL)canBecomeMainWindow
@@ -667,7 +667,7 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop()
return NO; // prevent the caption to be redrawn as active on click
// when another modal window is currently the key win
- return !(w->tooltip_window() || w->menu_window() || w->parent());
+ return !(!w || w->tooltip_window() || w->menu_window() || w->parent());
}
- (void)recursivelySendToSubwindows:(SEL)sel