[hb-subset] Try to fix leak

This commit is contained in:
Behdad Esfahbod 2025-04-06 16:04:17 -06:00
parent f09c4d6dd8
commit fd9903fc4e
2 changed files with 8 additions and 4 deletions

View file

@ -33,12 +33,16 @@ struct face_options_t
{
~face_options_t ()
{
g_free (face_loader);
g_free (font_file);
g_free (face_loader);
hb_face_destroy (face);
}
void set_face (hb_face_t *face_)
{ face = face_; }
{
hb_face_destroy (face);
face = hb_face_reference (face_);
}
void add_options (option_parser_t *parser);
@ -116,7 +120,7 @@ face_options_t::post_parse (GError **error)
}
}
face = cache.face;
set_face (cache.face);
}
static G_GNUC_NORETURN gboolean

View file

@ -71,7 +71,7 @@ struct subset_main_t : option_parser_t, face_options_t, output_options_t<false>
main2.option_parser_t::parse (&argc, &args);
g_free (args);
set_face (hb_face_reference (main2.face));
set_face (main2.face);
}
void parse (int argc, char **argv)