fix a bunch of memleaks from valgrind and stuff
Dana Jansens danakj@orodu.net
8 files changed,
48 insertions(+),
5 deletions(-)
M
openbox/openbox.c
→
openbox/openbox.c
@@ -235,6 +235,7 @@ /* parse/load user options */
if (parse_load_rc(&doc, &node)) parse_tree(i, doc, node->xmlChildrenNode); /* we're done with parsing now, kill it */ + xmlFreeDoc(doc); parse_shutdown(i); menu_parse();@@ -290,6 +291,10 @@ RrInstanceFree(ob_rr_inst);
session_shutdown(); g_free(ob_sm_id); + +#ifdef USE_LIBSN + sn_display_unref(ob_sn_display); +#endif XCloseDisplay(ob_display);
M
openbox/prop.c
→
openbox/prop.c
@@ -392,6 +392,7 @@ str = g_string_append_c(str, '\0');
} XChangeProperty(ob_display, win, prop, prop_atoms.utf8, 8, PropModeReplace, (guchar*)str->str, str->len); + g_string_free(str, TRUE); } void prop_erase(Window win, Atom prop)
M
openbox/screen.c
→
openbox/screen.c
@@ -67,6 +67,7 @@ Time timestamp;
wm_sn = g_strdup_printf("WM_S%d", ob_screen); wm_sn_atom = XInternAtom(ob_display, wm_sn, FALSE); + g_free(wm_sn); current_wm_sn_owner = XGetSelectionOwner(ob_display, wm_sn_atom); if (current_wm_sn_owner) {
M
render/color.c
→
render/color.c
@@ -59,6 +59,8 @@
void RrColorFree(RrColor *c) { if (c) { + if (c->pixel) XFreeColors(RrDisplay(c->inst), RrColormap(c->inst), + &c->pixel, 1, 0); if (c->gc) XFreeGC(RrDisplay(c->inst), c->gc); g_free(c); }
M
render/font.c
→
render/font.c
@@ -226,5 +226,7 @@
XftDrawStringUtf8(d, &c, t->font->xftfont, x, t->font->xftfont->ascent + y, (FcChar8*)text->str, l); + + g_string_free(text, TRUE); return; }
M
render/theme.c
→
render/theme.c
@@ -506,14 +506,20 @@ if (!read_appearance(db, inst,
"window.button.toggled.focus", theme->a_toggled_focused_max, TRUE)) + { + RrAppearanceFree(theme->a_toggled_focused_max); theme->a_toggled_focused_max = RrAppearanceCopy(theme->a_focused_pressed_max); + } if (!read_appearance(db, inst, "window.button.toggled.unfocus", theme->a_toggled_unfocused_max, TRUE)) + { + RrAppearanceFree(theme->a_toggled_unfocused_max); theme->a_toggled_unfocused_max = RrAppearanceCopy(theme->a_unfocused_pressed_max); + } if (!read_appearance(db, inst, "window.button.focus", theme->a_focused_unpressed_max,@@ -528,14 +534,20 @@ if (!read_appearance(db, inst,
"window.button.hover.focus", theme->a_hover_focused_max, TRUE)) + { + RrAppearanceFree(theme->a_hover_focused_max); theme->a_hover_focused_max = RrAppearanceCopy(theme->a_focused_unpressed_max); + } if (!read_appearance(db, inst, "window.button.hover.unfocus", theme->a_hover_unfocused_max, TRUE)) + { + RrAppearanceFree(theme->a_hover_unfocused_max); theme->a_hover_unfocused_max = RrAppearanceCopy(theme->a_unfocused_unpressed_max); + } theme->a_disabled_focused_close = RrAppearanceCopy(theme->a_disabled_focused_max);@@ -877,6 +889,7 @@ RrColorFree(theme->menu_color);
RrColorFree(theme->menu_title_color); RrColorFree(theme->menu_disabled_color); RrColorFree(theme->menu_hilite_color); + RrColorFree(theme->menu_bullet_color); RrPixmapMaskFree(theme->max_mask); RrPixmapMaskFree(theme->max_toggled_mask);