From 2b7758a8763a8fe6ca13a2f04e0137df79c849d2 Mon Sep 17 00:00:00 2001 From: "Pierre-Loup A. Griffais" Date: Fri, 17 May 2013 20:18:01 -0700 Subject: Don't leak RENDER Pictures in QPixmap::paintEngine(). Qt 5 doesn't use serverside pixmaps, so doesn't need this patch. Change-Id: I5ad456679efd3706582dd1e6ca8e6b4404298739 Reviewed-by: Laszlo Agocs Reviewed-by: Shawn Rutledge --- src/gui/image/qpixmap_x11.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 45cf31f104..b3bdf657e4 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -2207,10 +2207,12 @@ QPaintEngine* QX11PixmapData::paintEngine() const ::Pixmap hd_copy = XCreatePixmap(X11->display, RootWindow(X11->display, xinfo.screen()), w, h, d); #if !defined(QT_NO_XRENDER) - XRenderPictFormat *format = qt_renderformat_for_depth(xinfo, d); - ::Picture picture_copy = XRenderCreatePicture(X11->display, hd_copy, format, 0, 0); - if (picture && d == 32) { + XRenderPictFormat *format = qt_renderformat_for_depth(xinfo, d); + ::Picture picture_copy = XRenderCreatePicture(X11->display, + hd_copy, format, + 0, 0); + XRenderComposite(X11->display, PictOpSrc, picture, 0, picture_copy, 0, 0, 0, 0, 0, 0, w, h); XRenderFreePicture(X11->display, picture); -- cgit v1.2.1