From 329b4127f6801d04ca0cdfadaf60f1265e8268c6 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 19 Dec 2001 18:15:34 +0000 Subject: Multiple bug fixes from Sebastien: - Fl_GIF_Image and Fl_PNG_Image didn't close the file before calling Fl::error(). - Fl_Help_View didn't clear the line array in Fl_Help_Block, and Fl_Help_Block::font and ::size were not used. - Fl_Shared_Image::get() didn't return NULL if the image could not be loaded. - Switched to more efficient code for Fl_Tiled_Image::color_average() and ::desaturate(). - Don't delete children in Fl_Text_Display since the group will do it. - Fixes to filename_isdir(), filename_absolute(), and filename_relative(). - Was using numbers instead of define constants for some OpenGL stuff under WIN32. - Wasn't exporting threading functions under WIN32. - The Fl_Widget destructor now removes from the parent to avoid a Purify error since the old widget would be referenced by the parent when it was destroyed; this has no apparent performance impact since Fl_Group::clear() sets children_ to 0, making Fl_Group::remove() very fast... - WIN32 font enumeration datatype fixes... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1878 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_GIF_Image.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/Fl_GIF_Image.cxx') diff --git a/src/Fl_GIF_Image.cxx b/src/Fl_GIF_Image.cxx index 5d6e469de..b6260d111 100644 --- a/src/Fl_GIF_Image.cxx +++ b/src/Fl_GIF_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_GIF_Image.cxx,v 1.1.2.6 2001/12/11 16:03:12 easysw Exp $" +// "$Id: Fl_GIF_Image.cxx,v 1.1.2.7 2001/12/19 18:15:33 easysw Exp $" // // Fl_GIF_Image routines. // @@ -92,8 +92,8 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { return; /* quit on eof */ } if (b[0]!='G' || b[1]!='I' || b[2] != 'F') { - Fl::error("%s is not a GIF file.\n", infname); fclose(GifFile); + Fl::error("%s is not a GIF file.\n", infname); return; } if (b[3]!='8' || b[4]>'9' || b[5]!= 'a') @@ -135,8 +135,8 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { int i = NEXTBYTE; if (i<0) { - Fl::error("%s: unexpected EOF",infname); fclose(GifFile); + Fl::error("%s: unexpected EOF",infname); return; } int blocklen; @@ -193,11 +193,6 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { } uchar *Image = new uchar[Width*Height]; - if (!Image) { - Fl::fatal("Insufficient memory for %s.", infname); - fclose(GifFile); - return; - } int YC = 0, Pass = 0; /* Used to de-interlace the picture */ uchar *p = Image; @@ -378,5 +373,5 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) { // -// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.6 2001/12/11 16:03:12 easysw Exp $". +// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.7 2001/12/19 18:15:33 easysw Exp $". // -- cgit v1.2.3