From 87b998ed1f7664a508e4c8906635a7b512b5168a Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Mon, 11 Apr 2011 20:10:02 +0000 Subject: [PATCH] Fixed crash on Mac OS when Fl::focus() called before show(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8577 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Fl.cxx b/src/Fl.cxx index f3d62b9c2..dbde5010c 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -847,7 +847,10 @@ void Fl::focus(Fl_Widget *o) { while (w1) { win=w1; w1=win->window(); } if (win) { #ifdef __APPLE__ - if (fl_xfocus != win) Fl_X::i(win)->set_key_window(); + if (fl_xfocus != win) { + Fl_X *x = Fl_X::i(win); + if (x) x->set_key_window(); + } #endif fl_xfocus = win; }