X11: fix crash when creating an Fl_Image_Surface object before fl_open_display() but after Fl::visual().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10866 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2015-09-24 08:04:07 +00:00
parent fe61175546
commit 430636e91d

View File

@ -31,7 +31,7 @@ Fl_Image_Surface::Fl_Image_Surface(int w, int h) : Fl_Surface_Device(NULL) {
height = h;
#if !(defined(__APPLE__) || defined(WIN32))
gc = 0;
if (!fl_display) { // allows use of this class before any window is shown
if (!fl_gc) { // allows use of this class before any window is shown
fl_open_display();
gc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0);
fl_gc = gc;