From 9cb0516301f030235dd955d0233ab30c7d8495bf Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 11 Feb 2015 08:59:26 +0000 Subject: Fixed error introduced at r.10568 that prevented non-Apple compilation. Also, replaced __APPLE_QUARTZ__ by __APPLE__ git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10571 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Image.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index b9b324004..3df1efde4 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -197,12 +197,17 @@ Fl_RGB_Image::Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg): /** The destructor frees all memory and server resources that are used by the image. */ Fl_RGB_Image::~Fl_RGB_Image() { +#ifdef __APPLE__ if (id_) CGImageRelease((CGImageRef)id_); else if (alloc_array) delete[] (uchar *)array; +#else + uncache(); + if (alloc_array) delete[] (uchar *)array; +#endif } void Fl_RGB_Image::uncache() { -#ifdef __APPLE_QUARTZ__ +#ifdef __APPLE__ if (id_) { if (mask_) *(bool*)mask_ = false; CGImageRelease((CGImageRef)id_); @@ -464,7 +469,7 @@ void Fl_RGB_Image::desaturate() { d(new_d); } -#if !defined(WIN32) && !defined(__APPLE_QUARTZ__) +#if !defined(WIN32) && !defined(__APPLE__) // Composite an image with alpha on systems that don't have accelerated // alpha compositing... static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, int cy) { @@ -521,7 +526,7 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i delete[] dst; } -#endif // !WIN32 && !__APPLE_QUARTZ__ +#endif // !WIN32 && !__APPLE__ void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) { fl_graphics_driver->draw(this, XP, YP, WP, HP, cx, cy); -- cgit v1.2.3