Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to disconnect an xcb_connection_t that I got from XGetXCBConnection?

Tags:

c++

c

xcb

xlib

Here's an example I saw for some GLX code:

display = XOpenDisplay(0);
// ...
xcb_connection_t *connection = XGetXCBConnection(display);
// ...
XCloseDisplay(display);

I noticed that there was no xcb_disconnect in there. Is this correct? Also, is connection still valid after the display is closed?

like image 807
Pubby Avatar asked Jun 16 '12 00:06

Pubby


1 Answers

XCloseDisplay seems to undo the creation of the display (hence destroying it), and since the XCB connection object is derived from the display, it would seem reasonable that the connection becomes invalidated once the display is closed.

like image 50
gvl Avatar answered Nov 19 '22 14:11

gvl