diff options
author | Carl Worth <cworth@cworth.org> | 2005-08-23 14:51:51 +0000 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2005-08-23 14:51:51 +0000 |
commit | c4c1c4db96549e4ffcbd0ee081661d54522860c9 (patch) | |
tree | 97af225daf134f3ac37ee44effae62c80cd90704 | |
parent | 2dfb7a662f63642d63a91e39ea1828957fab0705 (diff) |
Remove assert statements that violate two intentional instances of ref_count == 0.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/cairo-font.c | 8 |
2 files changed, 12 insertions, 2 deletions
@@ -1,5 +1,11 @@ 2005-08-23 Carl Worth <cworth@cworth.org> + * src/cairo-font.c: (cairo_font_face_reference), + (cairo_scaled_font_reference): Remove assert statements that + violate two intentional instances of ref_count == 0. + +2005-08-23 Carl Worth <cworth@cworth.org> + * test/text-pattern.c: (draw): Fix memory leak of pattern. 2005-08-23 Owen Taylor <otaylor@redhat.com> diff --git a/src/cairo-font.c b/src/cairo-font.c index 5e649ec4..947d7c88 100644 --- a/src/cairo-font.c +++ b/src/cairo-font.c @@ -85,7 +85,9 @@ cairo_font_face_reference (cairo_font_face_t *font_face) if (font_face->ref_count == (unsigned int)-1) return font_face; - assert (font_face->ref_count > 0); + /* We would normally assert (font_face->ref_count >0) here but we + * can't get away with that due to the zombie case as documented + * in _cairo_ft_font_face_destroy. */ font_face->ref_count++; @@ -764,7 +766,9 @@ cairo_scaled_font_reference (cairo_scaled_font_t *scaled_font) if (scaled_font->ref_count == (unsigned int)-1) return scaled_font; - assert (scaled_font->ref_count > 0); + /* We would normally assert (scaled_font->ref_count > 0) here, but + * we are using ref_count == 0 as a legitimate case for the + * holdovers array. See below. */ /* If the original reference count is 0, then this font must have * been found in font_map->holdovers, (which means this caching is |