From 5a579962a627a258e725e3b51652f8fe45359619 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 19 Dec 2017 12:56:24 +0000 Subject: [PATCH] Fix Fl_GDI_Graphics_Driver::uncache(Fl_RGB_Image*,...) that did not delete correctly the cached offscreen object. This bug was detected by a test program that rotates an SVG image. But it's not related to SVG, and concerns any Fl_RGB_Image on the WIN32 platform. It was introduced when image support was modified according to the driver model. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12600 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Graphics_Driver.cxx | 1 - src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index eb3c48c27..ea330f17a 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -181,7 +181,6 @@ int Fl_Graphics_Driver::start_image(Fl_Image *img, int XP, int YP, int WP, int H /** Support function for image drawing */ void Fl_Graphics_Driver::uncache_pixmap(fl_uintptr_t p) { - fl_delete_offscreen((Fl_Offscreen)p); } diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index 350381d9e..e6d471b0b 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -3,7 +3,7 @@ // // WIN32 image drawing code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2016 by Bill Spitzak and others. +// Copyright 1998-2017 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -559,7 +559,7 @@ int Fl_GDI_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, int WP, i void Fl_GDI_Graphics_Driver::uncache(Fl_RGB_Image*, fl_uintptr_t &id_, fl_uintptr_t &mask_) { if (id_) { - fl_delete_offscreen((Fl_Offscreen)id_); + DeleteObject((Fl_Offscreen)id_); id_ = 0; }