diff --git a/plugins/linux-capture/xcompcap-helper.cpp b/plugins/linux-capture/xcompcap-helper.cpp index 088af4f83..5922a4888 100644 --- a/plugins/linux-capture/xcompcap-helper.cpp +++ b/plugins/linux-capture/xcompcap-helper.cpp @@ -373,6 +373,8 @@ void XErrorLock::lock() void XErrorLock::unlock() { if (islock) { + XSync(XCompcap::disp(), 0); + curErrorTarget = 0; XSetErrorHandler(prevhandler); prevhandler = 0; diff --git a/plugins/linux-capture/xcompcap-main.cpp b/plugins/linux-capture/xcompcap-main.cpp index 9c02f7888..d894795c6 100644 --- a/plugins/linux-capture/xcompcap-main.cpp +++ b/plugins/linux-capture/xcompcap-main.cpp @@ -234,6 +234,9 @@ static Window getWindowFromString(std::string wstr) static void xcc_cleanup(XCompcapMain_private *p) { + PLock lock(&p->lock); + XErrorLock xlock; + if (p->gltex) { gs_texture_destroy(p->gltex); p->gltex = 0;