Made QXcbConnection::atomName() more fail safe.
Reviewed-by: Samuel Rødal
This commit is contained in:
parent
dc01995397
commit
0909a0bbfb
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user