Made QXcbConnection::atomName() more fail safe.

Reviewed-by: Samuel Rødal
This commit is contained in:
Laszlo Agocs 2011-05-30 15:48:22 +02:00
parent dc01995397
commit 0909a0bbfb

View File

@ -730,9 +730,12 @@ QByteArray QXcbConnection::atomName(xcb_atom_t atom)
{
xcb_get_atom_name_cookie_t cookie = xcb_get_atom_name_unchecked(xcb_connection(), atom);
xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(xcb_connection(), cookie, 0);
QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));
free(reply);
return result;
if (reply) {
QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));
free(reply);
return result;
}
return QByteArray();
}
void QXcbConnection::sync()