From b56c9384bcc177236debd26fdbbf14319e4c62b9 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Wed, 14 Feb 2018 16:05:39 -0800 Subject: [PATCH] [subset] Add missing face reference in hb-subset-plan plus ensure all struct members are cleaned up on destroy. --- src/hb-subset-plan.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 0381e25cc..034180a0c 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -163,7 +163,7 @@ hb_subset_plan_create (hb_face_t *face, plan->codepoints.init(); plan->gids_to_retain.init(); plan->gids_to_retain_sorted.init(); - plan->source = face; + plan->source = hb_face_reference (face); plan->dest = hb_subset_face_create (); _populate_codepoints (input->unicodes, plan->codepoints); @@ -189,5 +189,8 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan) plan->gids_to_retain.finish (); plan->gids_to_retain_sorted.finish (); + hb_face_destroy (plan->source); + hb_face_destroy (plan->dest); + free (plan); }