From 7d17fcdf1e36b51d3a87b0e10921476071bcc6b3 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 4 Nov 2011 04:01:45 -0500 Subject: [PATCH] fix memory leak --- xcompmgr.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/xcompmgr.c b/xcompmgr.c index 4d25404..90584e8 100644 --- a/xcompmgr.c +++ b/xcompmgr.c @@ -431,17 +431,17 @@ make_gaussian_map(Display *dpy, double r) { /* * A picture will help * - * -center 0 width width+center + * -center 0 width width+center * -center +-----+-------------------+-----+ - * | | | | - * | | | | - * 0 +-----+-------------------+-----+ - * | | | | - * | | | | - * | | | | + * | | | | + * | | | | + * 0 +-----+-------------------+-----+ + * | | | | + * | | | | + * | | | | * height +-----+-------------------+-----+ - * | | | | - * height+ | | | | + * | | | | + * height+ | | | | * center +-----+-------------------+-----+ */ @@ -1635,6 +1635,12 @@ finish_destroy_win(Display *dpy, Window id) { w->shadow_pict = None; } + /* fix leak, from freedesktop repo */ + if (w->shadow) { + XRenderFreePicture (dpy, w->shadow); + w->shadow = None; + } + if (w->damage != None) { set_ignore(dpy, NextRequest(dpy)); XDamageDestroy(dpy, w->damage);