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.
This commit is contained in:
jp9000
2016-01-25 08:43:32 -08:00
parent c392164f03
commit 756fec3503
2 changed files with 5 additions and 0 deletions

View File

@@ -373,6 +373,8 @@ void XErrorLock::lock()
void XErrorLock::unlock()
{
if (islock) {
XSync(XCompcap::disp(), 0);
curErrorTarget = 0;
XSetErrorHandler(prevhandler);
prevhandler = 0;

View File

@@ -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;