From ffac6ee2673a573a9db4f75a89c4c53251fa1304 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 29 Dec 2013 21:39:17 +0100 Subject: XCB: Fix pixmap leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In qt_xcb_XPixmapFromBitmap(), a new pixmap is generated for the caller. This pixmap has to be freed after use. However, createNonStandardCursor() didn't do this and instead leaked the pixmap. Change-Id: I6fee180ec6508db9e82a5bb028957e7d9f7a4632 Signed-off-by: Uli Schlachter Reviewed-by: Shawn Rutledge Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qxcbcursor.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index 11848d503b..15e5bf27f1 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -483,6 +483,8 @@ xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) xcb_pixmap_t pmm = qt_xcb_XPixmapFromBitmap(m_screen, image.createAlphaMask()); cursor = xcb_generate_id(conn); xcb_create_cursor(conn, cursor, pm, pmm, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, 8, 8); + xcb_free_pixmap(conn, pm); + xcb_free_pixmap(conn, pmm); } } -- cgit v1.2.3