[COLR] Fix memory leak

This commit is contained in:
Behdad Esfahbod 2025-03-03 16:31:41 -07:00
parent 628b868f44
commit 50fe45f43c

View file

@ -2120,7 +2120,18 @@ struct COLR
accelerator_t (hb_face_t *face)
{ colr = hb_sanitize_context_t ().reference_table<COLR> (face); }
~accelerator_t () { this->colr.destroy (); }
~accelerator_t ()
{
auto *scratch = cached_scratch.get_relaxed ();
if (scratch)
{
scratch->~hb_colr_scratch_t ();
hb_free (scratch);
}
colr.destroy ();
}
bool has_data () const { return colr->has_data (); }