Browse files

Merge pull request #9 from Cloudef/master

Fix leak when switching XFT fonts
  • Loading branch information...
2 parents f426751 + ef8829b commit f7907da3a42a6d59e27ede88f5f01e4e41c4c9e0 @robm committed Dec 4, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 draw.c
View
2 draw.c
@@ -155,6 +155,8 @@ setfont(const char *fontstr) {
}
dzen.font.height = dzen.font.ascent + dzen.font.descent;
#else
+ if(dzen.font.xftfont)
+ XftFontClose(dzen.dpy, dzen.font.xftfont);
dzen.font.xftfont = XftFontOpenXlfd(dzen.dpy, dzen.screen, fontstr);
if(!dzen.font.xftfont)
dzen.font.xftfont = XftFontOpenName(dzen.dpy, dzen.screen, fontstr);

0 comments on commit f7907da

Please sign in to comment.