From 6ae1c87c756b5a8c1058a522b3a21354843fee8f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 20 Jan 2014 10:51:38 +0100 Subject: [PATCH] xcb: Do not leak when compressing events The event must be freed in all cases, also when a motion or configure notify is skipped. Change-Id: Ie55e62d0c3ab25bd9b20cc85098ea337d0b1ac5d Reviewed-by: Uli Schlachter Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 0cff92dacc..030090d98d 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1154,6 +1154,7 @@ void QXcbConnection::processXcbEvents() xcb_generic_event_t *event = eventqueue->at(i); if (!event) continue; + QScopedPointer eventGuard(event); (*eventqueue)[i] = 0; uint response_type = event->response_type & ~0x80; @@ -1204,8 +1205,6 @@ void QXcbConnection::processXcbEvents() handleXcbEvent(event); m_reader->lock(); } - - free(event); } eventqueue->clear();