[gs-commits] mupdf 1.16.1.45 Tweak harfbuzz calls so memento doesn't r

[email protected] (Robin Watts) Fri, 27 Sep 2019 13:25:28 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit a1e68d36d007ad8cda480c586b77e1d5af77a495
Author: Robin Watts <[email protected]>
Date:   Fri Sep 27 13:24:11 2019 +0100

    Tweak harfbuzz calls so memento doesn't report leaked blocks.
    
    Harfbuzz allocates some blocks that it never frees. Rather than
    report these every time, tell Memento that they are known leaks.

diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index 9f8b6c2..2cb6416 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -157,7 +157,9 @@ static int walk_string(string_walker *walker)
 		if (walker->language)
 		{
 			fz_string_from_text_language(lang, walker->language);
+			Memento_startLeaking(); /* HarfBuzz leaks harmlessly */
 			hb_buffer_set_language(walker->hb_buf, hb_language_from_string(lang, (int)strlen(lang)));
+			Memento_stopLeaking(); /* HarfBuzz leaks harmlessly */
 		}
 		/* hb_buffer_set_cluster_level(hb_buf, HB_BUFFER_CLUSTER_LEVEL_CHARACTERS); */
 
@@ -827,7 +829,9 @@ fz_layout_html(fz_context *ctx, fz_html *html, float w, float h, float em)
 
 	fz_try(ctx)
 	{
+		Memento_startLeaking(); /* HarfBuzz leaks harmlessly */
 		hb_buf = hb_buffer_create();
+		Memento_stopLeaking(); /* HarfBuzz leaks harmlessly */
 		unlocked = 1;
 		fz_hb_unlock(ctx);
 

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

--
MuPDF library
Artifex Software, Inc.