XCB: Fix pixmap leak

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 <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
This commit is contained in:
Uli Schlachter 2013-12-29 21:39:17 +01:00 committed by The Qt Project
parent 8b17f13c09
commit ffac6ee267

View File

@ -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);
}
}