From fd3dc25ae8512d3acdd29d3ea5c8643724c29e7b Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 25 Mar 2017 04:21:40 -0700 Subject: composite: fix root_buffer leak on invalidate root This doesn't happen frequently and has gone utterly unnoticed as harmless, but it's something I noticed in reviewing the code for more lingering style issues. --- src/composite.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/composite.c b/src/composite.c index 7f06cec..76a6d81 100644 --- a/src/composite.c +++ b/src/composite.c @@ -164,10 +164,15 @@ void vwm_composite_invalidate_root(vwm_t *vwm) if (!compositing_mode) return; - if (root_picture) XRenderFreePicture(VWM_XDISPLAY(vwm), root_picture); - root_picture = None; - if (root_buffer) XRenderFreePicture(VWM_XDISPLAY(vwm), root_picture); - root_buffer = None; + if (root_picture) { + XRenderFreePicture(VWM_XDISPLAY(vwm), root_picture); + root_picture = None; + } + + if (root_buffer) { + XRenderFreePicture(VWM_XDISPLAY(vwm), root_buffer); + root_buffer = None; + } } void vwm_composite_repaint_needed(vwm_t *vwm) -- cgit v1.2.3