mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 11:05:18 +00:00
Fix all memleaks that are clearly visible,
the default config should now run without memleaks, valgrind will still report memleaks caused by the own_window-lines and the xft-lines (in some cases) but those are caused by code that's not part of conky
This commit is contained in:
parent
4addf71241
commit
4c241bbf16
@ -52,6 +52,7 @@ void setup_fonts(void)
|
|||||||
if (use_xft) {
|
if (use_xft) {
|
||||||
if (window.xftdraw) {
|
if (window.xftdraw) {
|
||||||
XftDrawDestroy(window.xftdraw);
|
XftDrawDestroy(window.xftdraw);
|
||||||
|
window.xftdraw = 0;
|
||||||
}
|
}
|
||||||
window.xftdraw = XftDrawCreate(display, window.drawable,
|
window.xftdraw = XftDrawCreate(display, window.drawable,
|
||||||
DefaultVisual(display, screen), DefaultColormap(display, screen));
|
DefaultVisual(display, screen), DefaultColormap(display, screen));
|
||||||
|
@ -194,7 +194,12 @@ void set_transparent_background(Window win)
|
|||||||
|
|
||||||
void destroy_window(void)
|
void destroy_window(void)
|
||||||
{
|
{
|
||||||
|
if(window.xftdraw) {
|
||||||
|
XftDrawDestroy(window.xftdraw);
|
||||||
|
}
|
||||||
|
if(window.gc) {
|
||||||
XFreeGC(display, window.gc);
|
XFreeGC(display, window.gc);
|
||||||
|
}
|
||||||
memset(&window, 0, sizeof(struct conky_window));
|
memset(&window, 0, sizeof(struct conky_window));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user