Prevent potential crash in QXcbConnection::checkEvent().

Change-Id: I4b2ed85fecbfc1cc4fecfa9bb37aa0d9bd329817
Reviewed-on: http://codereview.qt-project.org/5616
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Samuel Rødal 2011-09-27 12:47:11 +02:00 committed by Qt by Nokia
parent 926d6189bf
commit 187184b6c7

View File

@ -679,7 +679,7 @@ xcb_generic_event_t *QXcbConnection::checkEvent(int type)
for (int i = 0; i < eventqueue->size(); ++i) {
xcb_generic_event_t *event = eventqueue->at(i);
if (event->response_type == type) {
if (event && event->response_type == type) {
(*eventqueue)[i] = 0;
m_reader->unlock();
return event;