File 0001-Don-t-leak-RENDER-Pictures-in-QPixmap-paintEngine.patch of Package libqt4

From 2b7758a8763a8fe6ca13a2f04e0137df79c849d2 Mon Sep 17 00:00:00 2001
From: "Pierre-Loup A. Griffais" <qt-project.org@plagman.net>
Date: Fri, 17 May 2013 20:18:01 -0700
Subject: [PATCH] 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 <laszlo.agocs@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
---
 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 45cf31f..b3bdf65 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);
-- 
2.0.4
openSUSE Build Service is sponsored by