diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-06-10 20:24:29 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-06-10 20:24:29 +0000 |
commit | ece78514e9a8707181cb3363190fff6df9096bc3 (patch) | |
tree | e65ea0223ad79cadf53c01f94e179083e7b31b41 /pango/pango-fontset.c | |
parent | ca70a54e8b9a9b5878308d94cceb8efc97b70b9b (diff) | |
download | pango-ece78514e9a8707181cb3363190fff6df9096bc3.tar.gz |
Don't leak raw_metrics and don't copy refcounts. (#84533)
* pango/pango-fontset.c (pango_fontset_real_get_metrics): Don't
leak raw_metrics and don't copy refcounts. (#84533)
Diffstat (limited to 'pango/pango-fontset.c')
-rw-r--r-- | pango/pango-fontset.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pango/pango-fontset.c b/pango/pango-fontset.c index 761f1c49..7ba883d1 100644 --- a/pango/pango-fontset.c +++ b/pango/pango-fontset.c @@ -133,21 +133,23 @@ pango_fontset_real_get_metrics (PangoFontset *fontset) { raw_metrics = pango_font_get_metrics (font, language); g_hash_table_insert (fonts_seen, font, font); - + if (count == 0) { - *metrics = *raw_metrics; + metrics->ascent = raw_metrics->ascent; + metrics->descent = raw_metrics->descent; metrics->approximate_char_width = raw_metrics->approximate_char_width; metrics->approximate_digit_width = raw_metrics->approximate_digit_width; } else - { + { metrics->ascent = MAX (metrics->ascent, raw_metrics->ascent); metrics->descent = MAX (metrics->descent, raw_metrics->descent); metrics->approximate_char_width += raw_metrics->approximate_char_width; metrics->approximate_digit_width += raw_metrics->approximate_digit_width; } count++; + pango_font_metrics_unref (raw_metrics); } else g_object_unref (font); |