fix two memleaks

This commit is contained in:
Mikael Magnusson 2006-06-11 10:21:35 +00:00
parent e0aa54a891
commit dd48997668
2 changed files with 4 additions and 3 deletions

View file

@ -203,12 +203,12 @@ RrFont *RrFontOpen(const RrInstance *inst, gchar *fontstring)
void RrFontClose(RrFont *f) void RrFontClose(RrFont *f)
{ {
if (f) { if (f) {
#ifdef USE_PANGO
pango_font_description_free(f->pango_font_description);
#endif
XftFontClose(RrDisplay(f->inst), f->xftfont); XftFontClose(RrDisplay(f->inst), f->xftfont);
g_free(f); g_free(f);
} }
#ifdef USE_PANGO
pango_font_description_free(f->pango_font_description);
#endif
} }
static void font_measure_full(const RrFont *f, const gchar *str, static void font_measure_full(const RrFont *f, const gchar *str,

View file

@ -329,6 +329,7 @@ void RrMinsize(RrAppearance *a, gint *w, gint *h)
*w = MAX(*w, m->width + 4); *w = MAX(*w, m->width + 4);
m->height = RrFontHeight(a->texture[i].data.text.font); m->height = RrFontHeight(a->texture[i].data.text.font);
*h += MAX(*h, m->height); *h += MAX(*h, m->height);
g_free(m);
break; break;
case RR_TEXTURE_RGBA: case RR_TEXTURE_RGBA:
*w += MAX(*w, a->texture[i].data.rgba.width); *w += MAX(*w, a->texture[i].data.rgba.width);