diff --git a/docs/changes.txt b/docs/changes.txt index 9c5f4a68e8..a31a055995 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -593,7 +593,8 @@ All (GUI): wxGTK: - Fix mouse wheel scrolling in wxListCtrl broken just before 3.0.0. -- Fix memory leak in wxSocket +- Fix memory leak in wxSocket. +- Fix raw access to wxBitmap pixels after drawing on it using wxMemoryDC. wxMSW: diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 6ab6bcb628..f81e7104a8 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -1428,6 +1428,11 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) } #else GdkPixbuf *pixbuf = GetPixbuf(); + + // Pixmap will get out of date when our pixbuf is accessed directly, so + // ensure we don't keep the old data in it. + PurgeOtherRepresentations(Pixbuf); + const bool hasAlpha = HasAlpha(); // allow access if bpp is valid and matches existence of alpha