From 9e95ce2a68ef167e17dccc5789cbf3bf74712280 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Fri, 29 Jan 2010 11:39:06 +0100 Subject: Fix GL texture leaks when pixmaps are deleted This fixes quite a lot of issues: * QtOpenGL only registered qpixmap destruction hooks on X11 and those only cleanup the EGL/GLX surface, not the texture object. * The QPixmap destruction hooks were only being called from the QPixmap destructor. However, this means when a QPixmap is assigned to another QPixmap, the hooks don't get called. Task-number: QTBUG-7647 Reviewed-By: Samuel Reviewed-By: Trond --- src/gui/image/qpixmap_x11.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gui/image/qpixmap_x11.cpp') diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 0e66e093c6..169a2ece26 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -68,6 +68,7 @@ #include "qx11info_x11.h" #include #include +#include #include @@ -1228,6 +1229,12 @@ void QX11PixmapData::fill(const QColor &fillColor) QX11PixmapData::~QX11PixmapData() { + // Cleanup hooks have to be called before the handles are freed + if (is_cached) { + QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(this); + is_cached = false; + } + release(); } -- cgit v1.2.3