summaryrefslogtreecommitdiff
path: root/pango/pango-fontset.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-06-10 20:24:29 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-06-10 20:24:29 +0000
commitece78514e9a8707181cb3363190fff6df9096bc3 (patch)
treee65ea0223ad79cadf53c01f94e179083e7b31b41 /pango/pango-fontset.c
parentca70a54e8b9a9b5878308d94cceb8efc97b70b9b (diff)
downloadpango-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.c8
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);