diff options
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 6 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 3 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 6 |
3 files changed, 5 insertions, 10 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index 9368836ca..050d1ac4d 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -491,8 +491,7 @@ void Fl_GDI_Graphics_Driver::cache(Fl_RGB_Image *img) } } Fl_Surface_Device::pop_current(); - Fl_Offscreen offs = surface->get_offscreen_before_delete(); - delete surface; + Fl_Offscreen offs = Fl_Graphics_Driver::get_offscreen_and_delete_image_surface(surface); int *pw, *ph; cache_w_h(img, pw, ph); *pw = img->data_w(); @@ -707,8 +706,7 @@ void Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img) { } *pbitmap = 0; Fl_Surface_Device::pop_current(); - Fl_Offscreen id = surf->get_offscreen_before_delete(); - delete surf; + Fl_Offscreen id = Fl_Graphics_Driver::get_offscreen_and_delete_image_surface(surf); int *pw, *ph; cache_w_h(img, pw, ph); *pw = img->data_w(); diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index ac705fcd5..c32a7b7f4 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -259,9 +259,8 @@ void Fl_Quartz_Graphics_Driver::cache(Fl_Pixmap *img) { Fl_Image_Surface *surf = new Fl_Image_Surface(img->data_w(), img->data_h()); Fl_Surface_Device::push_current(surf); fl_draw_pixmap(img->data(), 0, 0, FL_BLACK); - CGContextRef src = surf->get_offscreen_before_delete(); Fl_Surface_Device::pop_current(); - delete surf; + CGContextRef src = Fl_Graphics_Driver::get_offscreen_and_delete_image_surface(surf); void *cgdata = CGBitmapContextGetData(src); int sw = CGBitmapContextGetWidth(src); int sh = CGBitmapContextGetHeight(src); diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index 68cb70833..dad106a02 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -712,8 +712,7 @@ void Fl_Xlib_Graphics_Driver::cache(Fl_RGB_Image *img) { Fl_Surface_Device::push_current(surface); fl_draw_image(img->array, 0, 0, img->data_w(), img->data_h(), depth, img->ld()); Fl_Surface_Device::pop_current(); - Fl_Offscreen off = surface->get_offscreen_before_delete(); - delete surface; + Fl_Offscreen off = Fl_Graphics_Driver::get_offscreen_and_delete_image_surface(surface); int *pw, *ph; cache_w_h(img, pw, ph); *pw = img->data_w(); @@ -879,8 +878,7 @@ void Fl_Xlib_Graphics_Driver::cache(Fl_Pixmap *pxm) { } *pbitmap = 0; Fl_Surface_Device::pop_current(); - Fl_Offscreen id = surf->get_offscreen_before_delete(); - delete surf; + Fl_Offscreen id = Fl_Graphics_Driver::get_offscreen_and_delete_image_surface(surf); int *pw, *ph; cache_w_h(pxm, pw, ph); *pw = pxm->data_w(); |
