From c31107167192a18130c4b096ef14ccba90ebf01a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 12 Jul 2019 22:19:38 -0400 Subject: coverage: Fix the copy implementation This should do a deep copy. --- pango/pango-coverage.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pango/pango-coverage.c b/pango/pango-coverage.c index 7f18b583..e982bd3b 100644 --- a/pango/pango-coverage.c +++ b/pango/pango-coverage.c @@ -88,7 +88,16 @@ pango_coverage_real_copy (PangoCoverage *coverage) copy = g_object_new (PANGO_TYPE_COVERAGE, NULL); if (coverage->chars) - copy->chars = hb_set_reference (coverage->chars); + { + int i; + + copy->chars = hb_set_create (); + for (i = hb_set_get_min (coverage->chars); i <= hb_set_get_max (coverage->chars); i++) + { + if (hb_set_has (coverage->chars, (hb_codepoint_t)i)) + hb_set_add (copy->chars, (hb_codepoint_t)i); + } + } return copy; } -- cgit v1.2.1