diff --git a/src/hb-object.hh b/src/hb-object.hh index 64abb0ce1..b79122ba1 100644 --- a/src/hb-object.hh +++ b/src/hb-object.hh @@ -37,6 +37,7 @@ #include "hb-mutex.hh" #include "hb-vector.hh" +#include /* * Lockable set @@ -284,6 +285,7 @@ static inline void hb_object_fini (Type *obj) if (user_data) { user_data->fini (); + user_data->~hb_user_data_array_t(); hb_free (user_data); user_data = nullptr; } @@ -306,6 +308,7 @@ retry: user_data = (hb_user_data_array_t *) hb_calloc (sizeof (hb_user_data_array_t), 1); if (unlikely (!user_data)) return false; + user_data = new (user_data) hb_user_data_array_t; user_data->init (); if (unlikely (!obj->header.user_data.cmpexch (nullptr, user_data))) {