From 941c301cebc5e636667cca1ae8f3938a25d770df Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 23 Feb 2016 20:37:22 +0000 Subject: Fix Fl_RGB_Image::uncache() and Fl_Bitmap::uncache(). It is not possible to use fl_graphics_driver in these functions because when they are called *fl_graphics_driver may have been deleted. A solution is to use Fl_Display_Device::display_device()->driver() instead which is always valid. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11212 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h | 1 - src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 5 ----- 2 files changed, 6 deletions(-) (limited to 'src/drivers/Xlib') diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h index 19078c366..276316213 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h @@ -59,7 +59,6 @@ public: void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1); fl_uintptr_t cache(Fl_Pixmap *img, int w, int h, const char *const*array); fl_uintptr_t cache(Fl_Bitmap *img, int w, int h, const uchar *array); - void uncache(Fl_Bitmap *img, fl_uintptr_t &id_); void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_); double width(const char *str, int n); double width(unsigned int c); diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index a653ca54d..591203174 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -768,11 +768,6 @@ fl_uintptr_t Fl_Xlib_Graphics_Driver::cache(Fl_Bitmap*, int w, int h, const ucha return (fl_uintptr_t)create_bitmask(w, h, array); } -void Fl_Xlib_Graphics_Driver::uncache(Fl_Bitmap*, fl_uintptr_t &id_) { - delete_bitmask((Fl_Offscreen)id_); -} - - void Fl_Xlib_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) { int X, Y, W, H; if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return; -- cgit v1.2.3