Fixed WIN32 crash when the file dialog window is cancelled.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8344 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2011-01-31 17:46:55 +00:00
parent b42f5ebdbf
commit caef04e057

View File

@ -88,7 +88,8 @@ void file_cb(const char *n) {
void button_cb(Fl_Widget *,void *) {
fl_file_chooser_callback(file_cb);
puts(fl_file_chooser("Image file?","*.{bm,bmp,gif,jpg,pbm,pgm,png,ppm,xbm,xpm}", name));
const char *fname = fl_file_chooser("Image file?","*.{bm,bmp,gif,jpg,pbm,pgm,png,ppm,xbm,xpm}", name);
puts(fname ? fname : "(null)"); fflush(stdout);
fl_file_chooser_callback(0);
}