From 756fec3503046e20ed6503cb822218b24374297e Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 25 Jan 2016 08:43:32 -0800 Subject: [PATCH] linux-capture: Clear x events when exiting handler This is probably not necessary but might fix an issue where errors pass through to other parts of the program, possibly causing the crash on exit related to the xcomposite capture. --- plugins/linux-capture/xcompcap-helper.cpp | 2 ++ plugins/linux-capture/xcompcap-main.cpp | 3 +++ 2 files changed, 5 insertions(+) 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;