Skip to content

Commit 2b7758a

Browse files
Pierre-Loup A. Griffaisec1oud
authored andcommitted
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 <[email protected]> Reviewed-by: Shawn Rutledge <[email protected]>
1 parent 6555ba0 commit 2b7758a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/gui/image/qpixmap_x11.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,10 +2207,12 @@ QPaintEngine* QX11PixmapData::paintEngine() const
22072207
::Pixmap hd_copy = XCreatePixmap(X11->display, RootWindow(X11->display, xinfo.screen()),
22082208
w, h, d);
22092209
#if !defined(QT_NO_XRENDER)
2210-
XRenderPictFormat *format = qt_renderformat_for_depth(xinfo, d);
2211-
::Picture picture_copy = XRenderCreatePicture(X11->display, hd_copy, format, 0, 0);
2212-
22132210
if (picture && d == 32) {
2211+
XRenderPictFormat *format = qt_renderformat_for_depth(xinfo, d);
2212+
::Picture picture_copy = XRenderCreatePicture(X11->display,
2213+
hd_copy, format,
2214+
0, 0);
2215+
22142216
XRenderComposite(X11->display, PictOpSrc, picture, 0, picture_copy,
22152217
0, 0, 0, 0, 0, 0, w, h);
22162218
XRenderFreePicture(X11->display, picture);

0 commit comments

Comments
 (0)