diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-07-28 17:44:49 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-08-04 15:45:43 +0900 |
commit | 5d191bafa26d2a88aa108823a2f3b9a321294fdc (patch) | |
tree | b15d7ed5571bfa5acb56c6e4333a16409738fc07 /src/loader | |
parent | 1743c4184bdecd0c50e9f6fa17cafa84407fa929 (diff) | |
download | external_mesa3d-5d191bafa26d2a88aa108823a2f3b9a321294fdc.zip external_mesa3d-5d191bafa26d2a88aa108823a2f3b9a321294fdc.tar.gz external_mesa3d-5d191bafa26d2a88aa108823a2f3b9a321294fdc.tar.bz2 |
loader/dri3: Destroy Present event context when destroying drawable v2
Without this, the X server may accumulate stale Present event contexts
if a client ends up creating and destroying DRI drawables for the same
window.
v2: Based on Chris Wilson's review:
* Use xcb_present_select_input_checked so that protocol errors
generated by old X servers can be handled gracefully
* Use xcb_discard_reply() instead of free(xcb_request_check())
Diffstat (limited to 'src/loader')
-rw-r--r-- | src/loader/loader_dri3_helper.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index 67d0c2c..e9fb97b 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -118,8 +118,14 @@ loader_dri3_drawable_fini(struct loader_dri3_drawable *draw) dri3_free_render_buffer(draw, draw->buffers[i]); } - if (draw->special_event) + if (draw->special_event) { + xcb_void_cookie_t cookie = + xcb_present_select_input_checked(draw->conn, draw->eid, draw->drawable, + XCB_PRESENT_EVENT_MASK_NO_EVENT); + + xcb_discard_reply(draw->conn, cookie.sequence); xcb_unregister_for_special_event(draw->conn, draw->special_event); + } } int |