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>
This commit is contained in:
Laszlo Agocs 2014-01-20 10:51:38 +01:00 committed by The Qt Project
parent ad5577df06
commit 6ae1c87c75

View File

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