fix memory leak

This commit is contained in:
Christopher Jeffrey 2011-11-04 04:01:45 -05:00
parent b0608d0c7c
commit 7d17fcdf1e
1 changed files with 15 additions and 9 deletions

View File

@ -431,17 +431,17 @@ make_gaussian_map(Display *dpy, double r) {
/* /*
* A picture will help * A picture will help
* *
* -center 0 width width+center * -center 0 width width+center
* -center +-----+-------------------+-----+ * -center +-----+-------------------+-----+
* | | | | * | | | |
* | | | | * | | | |
* 0 +-----+-------------------+-----+ * 0 +-----+-------------------+-----+
* | | | | * | | | |
* | | | | * | | | |
* | | | | * | | | |
* height +-----+-------------------+-----+ * height +-----+-------------------+-----+
* | | | | * | | | |
* height+ | | | | * height+ | | | |
* center +-----+-------------------+-----+ * center +-----+-------------------+-----+
*/ */
@ -1635,6 +1635,12 @@ finish_destroy_win(Display *dpy, Window id) {
w->shadow_pict = None; w->shadow_pict = None;
} }
/* fix leak, from freedesktop repo */
if (w->shadow) {
XRenderFreePicture (dpy, w->shadow);
w->shadow = None;
}
if (w->damage != None) { if (w->damage != None) {
set_ignore(dpy, NextRequest(dpy)); set_ignore(dpy, NextRequest(dpy));
XDamageDestroy(dpy, w->damage); XDamageDestroy(dpy, w->damage);