summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-08-28 19:10:36 +0000
committerDana Jansens <danakj@orodu.net>2003-08-28 19:10:36 +0000
commit700e551390a86ffdb92ddc061914ec7687658d18 (patch)
treef896dc0c68f12503e17fd13dad3615242fb7f87d /render
parent5baa7c802a500ee30fe9719f226d88923ee6e59d (diff)
fix a bunch of memleaks from valgrind and stuff
Diffstat (limited to 'render')
-rw-r--r--render/color.c2
-rw-r--r--render/font.c2
-rw-r--r--render/theme.c13
3 files changed, 17 insertions, 0 deletions
diff --git a/render/color.c b/render/color.c
index d16bbf0c..37ef5532 100644
--- a/render/color.c
+++ b/render/color.c
@@ -59,6 +59,8 @@ RrColor *RrColorNew(const RrInstance *inst, gint r, gint g, gint b)
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);
}
diff --git a/render/font.c b/render/font.c
index 94d9fa2d..a099c093 100644
--- a/render/font.c
+++ b/render/font.c
@@ -226,5 +226,7 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
XftDrawStringUtf8(d, &c, t->font->xftfont, x,
t->font->xftfont->ascent + y,
(FcChar8*)text->str, l);
+
+ g_string_free(text, TRUE);
return;
}
diff --git a/render/theme.c b/render/theme.c
index 26f67c4d..2db767e6 100644
--- a/render/theme.c
+++ b/render/theme.c
@@ -506,14 +506,20 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
"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 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
"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 @@ void RrThemeFree(RrTheme *theme)
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);