[object] Call destructor in hb_object_destroy()
This commit is contained in:
parent
9ea4ab6051
commit
e1b5f2f806
|
@ -105,8 +105,6 @@ hb_map_destroy (hb_map_t *map)
|
|||
{
|
||||
if (!hb_object_destroy (map)) return;
|
||||
|
||||
map->fini_shallow ();
|
||||
|
||||
hb_free (map);
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@ void hb_hashmap_destroy (hb_hashmap_t<K, V>* map)
|
|||
{
|
||||
if (!hb_object_destroy (map))
|
||||
return;
|
||||
map->fini_shallow ();
|
||||
|
||||
hb_free (map);
|
||||
}
|
||||
|
||||
|
|
|
@ -272,6 +272,9 @@ static inline bool hb_object_destroy (Type *obj)
|
|||
return false;
|
||||
|
||||
hb_object_fini (obj);
|
||||
|
||||
obj->~Type ();
|
||||
|
||||
return true;
|
||||
}
|
||||
template <typename Type>
|
||||
|
@ -283,7 +286,7 @@ static inline void hb_object_fini (Type *obj)
|
|||
{
|
||||
user_data->fini ();
|
||||
hb_free (user_data);
|
||||
user_data = nullptr;
|
||||
obj->header.user_data.set_relaxed (nullptr);
|
||||
}
|
||||
}
|
||||
template <typename Type>
|
||||
|
|
|
@ -105,8 +105,6 @@ hb_set_destroy (hb_set_t *set)
|
|||
{
|
||||
if (!hb_object_destroy (set)) return;
|
||||
|
||||
set->fini_shallow ();
|
||||
|
||||
hb_free (set);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,10 +318,6 @@ hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
|
|||
{
|
||||
if (!hb_object_destroy (shape_plan)) return;
|
||||
|
||||
#ifndef HB_NO_OT_SHAPE
|
||||
shape_plan->ot.fini ();
|
||||
#endif
|
||||
shape_plan->key.fini ();
|
||||
hb_free (shape_plan);
|
||||
}
|
||||
|
||||
|
|
|
@ -761,7 +761,6 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan)
|
|||
if (!hb_object_destroy (plan)) return;
|
||||
|
||||
hb_set_destroy (plan->unicodes);
|
||||
plan->unicode_to_new_gid_list.fini ();
|
||||
hb_set_destroy (plan->name_ids);
|
||||
hb_set_destroy (plan->name_languages);
|
||||
hb_set_destroy (plan->layout_features);
|
||||
|
@ -796,7 +795,6 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan)
|
|||
if (plan->user_axes_location)
|
||||
{
|
||||
hb_object_destroy (plan->user_axes_location);
|
||||
plan->user_axes_location->fini_shallow ();
|
||||
hb_free (plan->user_axes_location);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue