libobs-opengl: Add xcb message poll to empty out the queue

The xcb message queue is not currently emptied.  If errors are generated
by any void requests the message queue will simply fill up and messages
will never be deleted.

Due to a (currently unknown) other problem this happens for me, and
results in OBS using up all memory with a queue that will never be
emptied.

Here we add a poll loop that will empty the xcb message queue and
discard the messages.  While this means that errors are still not
handled, OBS wont end up crashing either.

Closes jp9000/obs-studio#675
This commit is contained in:
Lasse Dalegaard 2016-10-29 17:31:15 +02:00 committed by jp9000
parent 64559a0cb8
commit ebd837d605

View File

@ -587,7 +587,12 @@ extern void device_present(gs_device_t *device)
initialized = true;
}
/* TODO: Handle XCB events. */
xcb_connection_t *xcb_conn = XGetXCBConnection(display);
xcb_generic_event_t *xcb_event;
while((xcb_event = xcb_poll_for_event(xcb_conn))) {
/* TODO: Handle XCB events. */
free(xcb_event);
}
switch (swap_type) {
case SWAP_TYPE_EXT: glXSwapIntervalEXT(display, window, 0); break;