diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-03-28 13:15:29 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-03-28 13:16:44 +0100 |
commit | c8b2cbbbc3cc9c7112929230b2d2cebe1d58e139 (patch) | |
tree | b6291848f5409fb8c442eb1d3366fce5c5a1ab19 | |
parent | 1273dbd57ada42420cecf961599e74661e0c7066 (diff) | |
download | mupdf-c8b2cbbbc3cc9c7112929230b2d2cebe1d58e139.tar.xz |
Label blocks that Harfbuzz leaks as leaked.
Tell Memento to treat all blocks allocated within given harfbuzz
calls as being leaks.
-rw-r--r-- | source/html/html-layout.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c index 99e0632a..6ac65845 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -710,7 +710,11 @@ static int walk_string(string_walker *walker) fz_throw(ctx, FZ_ERROR_GENERIC, "Failure sizing font (%d)", fterr); if (walker->font->shaper == NULL) + { + Memento_startLeaking(); /* HarfBuzz leaks harmlessly */ walker->font->shaper = (void *)hb_ft_font_create(face, NULL); + Memento_stopLeaking(); + } hb_buffer_clear_contents(walker->hb_buf); hb_buffer_set_direction(walker->hb_buf, walker->r2l ? HB_DIRECTION_RTL : HB_DIRECTION_LTR); @@ -721,7 +725,9 @@ static int walk_string(string_walker *walker) /* First put the text content into a harfbuzz buffer * labelled with the position within the word. */ hb_buffer_add_utf8(walker->hb_buf, walker->start, walker->end - walker->start, 0, -1); + Memento_startLeaking(); /* HarfBuzz leaks harmlessly */ hb_buffer_guess_segment_properties(walker->hb_buf); + Memento_stopLeaking(); /* Now shape that buffer */ hb_shape(walker->font->shaper, walker->hb_buf, NULL, 0); |