diff --git a/src/OpenDis.c b/src/OpenDis.c index d8be825..9c327d1 100644 --- a/src/OpenDis.c +++ b/src/OpenDis.c @@ -882,6 +882,10 @@ void _XFreeDisplayStructure(dpy) Xfree (dpy->scratch_buffer); FreeDisplayLock(dpy); +#if USE_XCB + _XCBShutdownDisplayLock(dpy); +#endif /* USE_XCB */ + if (dpy->qfree) { register _XQEvent *qelt = dpy->qfree; diff --git a/src/Xxcbint.h b/src/Xxcbint.h index 956c891..cc73749 100644 --- a/src/Xxcbint.h +++ b/src/Xxcbint.h @@ -45,6 +45,7 @@ void _XFreeX11XCBStructure(Display *dpy); /* xcb_lock.c */ int _XCBInitDisplayLock(Display *dpy); +void _XCBShutdownDisplayLock(Display *dpy); /* _XGetXCBBuffer and _XPutXCBBuffer calls must be paired and must not * be nested. */ diff --git a/src/xcb_lock.c b/src/xcb_lock.c index fab8b44..0ace8e5 100644 --- a/src/xcb_lock.c +++ b/src/xcb_lock.c @@ -47,6 +47,14 @@ int _XCBInitDisplayLock(Display *dpy) return 1; } +void _XCBShutdownDisplayLock(Display *dpy) +{ + if(dpy->lock_fns) { + Xfree((char *)dpy->lock_fns); + dpy->lock_fns = NULL; + } +} + void _XGetXCBBuffer(Display *dpy) { static const xReq dummy_request;