From 2c16ddb964a8e13532f8e4c6e5bf0da0af283745 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 21 Dec 2006 22:39:11 +0000 Subject: [PATCH] Fixed silly bug in OS X that would free a pixmap multiple times within Fl_RGB_Image::unchache. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5566 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Image.cxx | 4 +++- test/boxtype.cxx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index bfb9a8eec..50922af92 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -130,8 +130,10 @@ Fl_RGB_Image::~Fl_RGB_Image() { void Fl_RGB_Image::uncache() { #ifdef __APPLE_QUARTZ__ - if (id) + if (id) { CGImageRelease((CGImageRef)id); + id = 0; + } #else if (id) { fl_delete_offscreen((Fl_Offscreen)id); diff --git a/test/boxtype.cxx b/test/boxtype.cxx index 7db8433f0..34819f601 100644 --- a/test/boxtype.cxx +++ b/test/boxtype.cxx @@ -60,6 +60,7 @@ int main(int argc, char ** argv) { Fl::get_system_colors(); Fl::background(113,113,198); #else // this code uses the nice bright blue background to show box vs. frame types + Fl::args(argc, argv); Fl::get_system_colors(); window->color(12);// light blue #endif