summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-01-20 10:51:38 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-20 19:35:06 +0100
commit6ae1c87c756b5a8c1058a522b3a21354843fee8f (patch)
tree4393c9e1807bb8740df18d552460aeeee7681ecc /src/plugins/platforms/xcb/qxcbconnection.cpp
parentad5577df06c3ace44684333a8b1a843716a75a0d (diff)
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 <psychon@znc.in> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp3
1 files changed, 1 insertions, 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<xcb_generic_event_t, QScopedPointerPodDeleter> 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();