From 3d8f1432e555af373e7ccc3b6fffc80b70533888 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 22 Feb 2017 09:37:39 -0800 Subject: composite: fix occluded region leak When vwm_composite_paint_all() short-circuited, occluded wasn't destroyed. Defer the occluded region create to its time of need, which is after the short-circuit, and followed immediately by its destruction. --- src/composite.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/composite.c b/src/composite.c index afa4add..df157f6 100644 --- a/src/composite.c +++ b/src/composite.c @@ -173,7 +173,7 @@ void vwm_composite_paint_all(vwm_t *vwm) { vwm_xwindow_t *xwin; XRenderColor bgcolor = {0x0000, 0x00, 0x00, 0xffff}; - Region occluded = XCreateRegion(); + Region occluded; static XserverRegion undamage_region = None; /* if there's no damage to repaint, short-circuit, this happens when compositing for overlays is disabled. */ @@ -196,6 +196,7 @@ void vwm_composite_paint_all(vwm_t *vwm) XFreePixmap(vwm->display, root_pixmap); } + occluded = XCreateRegion(); /* compose overlays for all visible windows up front in a separate pass (kind of lame, but it's simpler since compose_overlay() adds to combined_damage) */ list_for_each_entry_prev(xwin, &vwm->xwindows, xwindows) { XRectangle r; -- cgit v1.2.3