diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2017-02-22 09:57:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-22 09:57:52 -0800 |
commit | 01cdfeea061ab3339b4e5cbf0964005d4c15bd5e (patch) | |
tree | c6d74a8551ee344e22795bb577095ef3fb5f5eba /src/composite.c | |
parent | 5b50e2a3affddb5693b91846b6c621590b8d21b2 (diff) | |
parent | 3d8f1432e555af373e7ccc3b6fffc80b70533888 (diff) |
Trivial cleanup and small (but continuous) memory leak fix
Tidy up vwm exit handling and stop leaking an X Region on every clean vwm_composite_paint_all().
If you noticed very long-running vwm instances hogging memory like a web browser, this is the culprit, vwm doesn't typically need much memory.
Diffstat (limited to 'src/composite.c')
-rw-r--r-- | src/composite.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |