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.
This commit is contained in:
Vadim Zeitlin 2015-04-01 14:36:35 +02:00
parent ffd2857571
commit d89d730900

View File

@ -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 );