xcb_connect always returns nonnull pointer, errors must be checked with xcb_connection_has_error (#720)
* xcb_connect always returns nonnull pointer, errors must be checked with xcb_connection_has_error: Fixed the error check to conform to XCB and assert nonnull pointer * merged with newest master from upstream (tagged ktx) Co-authored-by: Wolfgang Draxinger <code@datenwolf.net> Co-authored-by: datenwolf <dw@kraeh.datenwolf.net>
This commit is contained in:
parent
d32663d569
commit
fd202bfc76
1 changed files with 7 additions and 2 deletions
|
|
@ -1821,8 +1821,13 @@ void VulkanExampleBase::initxcbConnection()
|
||||||
xcb_screen_iterator_t iter;
|
xcb_screen_iterator_t iter;
|
||||||
int scr;
|
int scr;
|
||||||
|
|
||||||
|
// xcb_connect always returns a non-NULL pointer to a xcb_connection_t,
|
||||||
|
// even on failure. Callers need to use xcb_connection_has_error() to
|
||||||
|
// check for failure. When finished, use xcb_disconnect() to close the
|
||||||
|
// connection and free the structure.
|
||||||
connection = xcb_connect(NULL, &scr);
|
connection = xcb_connect(NULL, &scr);
|
||||||
if (connection == NULL) {
|
assert( connection );
|
||||||
|
if( xcb_connection_has_error(connection) ) {
|
||||||
printf("Could not find a compatible Vulkan ICD!\n");
|
printf("Could not find a compatible Vulkan ICD!\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue