Add hb_object_fini()

This commit is contained in:
Behdad Esfahbod 2018-05-01 18:39:25 -04:00
parent bd5f918e2f
commit 17618ee2ec
1 changed files with 6 additions and 1 deletions

View File

@ -165,9 +165,14 @@ static inline bool hb_object_destroy (Type *obj)
if (obj->header.ref_count.dec () != 1)
return false;
hb_object_fini (obj);
return true;
}
template <typename Type>
static inline void hb_object_fini (Type *obj)
{
obj->header.ref_count.finish (); /* Do this before user_data */
obj->header.user_data.finish ();
return true;
}
template <typename Type>
static inline bool hb_object_set_user_data (Type *obj,