From d89d730900a46bb433757a097cb6fe90e68352b1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Apr 2015 14:36:35 +0200 Subject: [PATCH] Fix bug with clearing shared alpha channel in wxImage::ClearAlpha(). Allocate our own exclusive copy of the data before modifying it, otherwise calling ClearAlpha() would clear alpha not only for the image it was called on but also for all the other images sharing data with it. --- src/common/image.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/image.cpp b/src/common/image.cpp index 8e4547aa74..2e906ac76a 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -2040,6 +2040,8 @@ void wxImage::ClearAlpha() { wxCHECK_RET( HasAlpha(), wxT("image already doesn't have an alpha channel") ); + AllocExclusive(); + if ( !M_IMGDATA->m_staticAlpha ) free( M_IMGDATA->m_alpha );