[gs-commits] mupdf 1.16.1.83 Improve labelling of leaked Harfbuzz bloc

[email protected] (Robin Watts) Fri, 4 Oct 2019 11:42:09 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit adba4d204f7934816b3b74b4550e9a57b2abe380
Author: Robin Watts <[email protected]>
Date:   Thu Oct 3 16:25:45 2019 +0100

    Improve labelling of leaked Harfbuzz blocks.

diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index 3c4534b..17da431 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -169,22 +169,20 @@ static int walk_string(string_walker *walker)
 		if (!quickshape)
 		{
 			fz_shaper_data_t *hb = fz_font_shaper_data(ctx, walker->font);
+			Memento_startLeaking(); /* HarfBuzz leaks harmlessly */
 			if (hb->shaper_handle == NULL)
 			{
-				Memento_startLeaking(); /* HarfBuzz leaks harmlessly */
 				hb->destroy = destroy_hb_shaper_data;
 				hb->shaper_handle = hb_ft_font_create(face, NULL);
-				Memento_stopLeaking();
 			}
 
-			Memento_startLeaking(); /* HarfBuzz leaks harmlessly */
 			hb_buffer_guess_segment_properties(walker->hb_buf);
-			Memento_stopLeaking();
 
 			if (walker->small_caps)
 				hb_shape(hb->shaper_handle, walker->hb_buf, small_caps_feature, nelem(small_caps_feature));
 			else
 				hb_shape(hb->shaper_handle, walker->hb_buf, NULL, 0);
+			Memento_stopLeaking();
 		}
 
 		walker->glyph_pos = hb_buffer_get_glyph_positions(walker->hb_buf, &walker->glyph_count);

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=adba4d204f7934816b3b74b4550e9a57b2abe380

--
MuPDF library
Artifex Software, Inc.