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 | |
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)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-1-2 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 5 | ||||
-rw-r--r-- | pango/pango-fontset.c | 8 |
7 files changed, 35 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2002-06-10 Matthias Clasen <maclas@gmx.de> + + * pango/pango-fontset.c (pango_fontset_real_get_metrics): Don't + leak raw_metrics and don't copy refcounts. (#84533) + Thu Jun 6 15:01:48 2002 Owen Taylor <otaylor@redhat.com> * pangoft2.pc.in (Cflags): Add @FREETYPE_CFLAGS@ diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 7f79db45..8ff75fbc 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,8 @@ +2002-06-10 Matthias Clasen <maclas@gmx.de> + + * pango/pango-fontset.c (pango_fontset_real_get_metrics): Don't + leak raw_metrics and don't copy refcounts. (#84533) + Thu Jun 6 15:01:48 2002 Owen Taylor <otaylor@redhat.com> * pangoft2.pc.in (Cflags): Add @FREETYPE_CFLAGS@ diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 7f79db45..8ff75fbc 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,8 @@ +2002-06-10 Matthias Clasen <maclas@gmx.de> + + * pango/pango-fontset.c (pango_fontset_real_get_metrics): Don't + leak raw_metrics and don't copy refcounts. (#84533) + Thu Jun 6 15:01:48 2002 Owen Taylor <otaylor@redhat.com> * pangoft2.pc.in (Cflags): Add @FREETYPE_CFLAGS@ diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 7f79db45..8ff75fbc 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,8 @@ +2002-06-10 Matthias Clasen <maclas@gmx.de> + + * pango/pango-fontset.c (pango_fontset_real_get_metrics): Don't + leak raw_metrics and don't copy refcounts. (#84533) + Thu Jun 6 15:01:48 2002 Owen Taylor <otaylor@redhat.com> * pangoft2.pc.in (Cflags): Add @FREETYPE_CFLAGS@ diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 7f79db45..8ff75fbc 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,8 @@ +2002-06-10 Matthias Clasen <maclas@gmx.de> + + * pango/pango-fontset.c (pango_fontset_real_get_metrics): Don't + leak raw_metrics and don't copy refcounts. (#84533) + Thu Jun 6 15:01:48 2002 Owen Taylor <otaylor@redhat.com> * pangoft2.pc.in (Cflags): Add @FREETYPE_CFLAGS@ diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 7f79db45..8ff75fbc 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,8 @@ +2002-06-10 Matthias Clasen <maclas@gmx.de> + + * pango/pango-fontset.c (pango_fontset_real_get_metrics): Don't + leak raw_metrics and don't copy refcounts. (#84533) + Thu Jun 6 15:01:48 2002 Owen Taylor <otaylor@redhat.com> * pangoft2.pc.in (Cflags): Add @FREETYPE_CFLAGS@ 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); |