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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top