summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2011-05-21 10:05:19 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2011-05-21 10:05:19 +0000
commitfce1e80ee33ca39232408b7fb7a43f6b4e4387b3 (patch)
tree457cfef9f7bcdd9e9f1e82ff7b73269328e56761 /FL
parentb87a0b73907b0d26bae5b7414f74e217706a70d8 (diff)
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
Diffstat (limited to 'FL')
-rw-r--r--FL/x.H2
1 files changed, 1 insertions, 1 deletions
diff --git a/FL/x.H b/FL/x.H
index b9be0343b..1a7a4625c 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -174,7 +174,7 @@ public:
extern FL_EXPORT char fl_override_redirect; // hack into Fl_X::make_xid()
extern FL_EXPORT int fl_background_pixel; // hack into Fl_X::make_xid()
-inline Window fl_xid(const Fl_Window* w) { return Fl_X::i(w)->xid; }
+inline Window fl_xid(const Fl_Window* w) { Fl_X *temp = Fl_X::i(w); return temp ? temp->xid : 0; }
#else