From fce1e80ee33ca39232408b7fb7a43f6b4e4387b3 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 21 May 2011 10:05:19 +0000 Subject: Fix potential crash in fl_xid() on Linux (STR #2635). This would crash if called when a window is not shown(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8706 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_x.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 913c7200d..95aff3d3e 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -1902,12 +1902,11 @@ void Fl_Window::make_current() { #endif } -Window fl_xid_(const Fl_Window* w) -{ - return Fl_X::i(w)->xid; +Window fl_xid_(const Fl_Window *w) { + Fl_X *temp = Fl_X::i(w); + return temp ? temp->xid : 0; } - int Fl_Window::decorated_h() { if (parent() || !shown()) return h(); -- cgit v1.2.3