diff options
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-object.hh')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-object.hh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/thirdparty/harfbuzz/src/hb-object.hh b/thirdparty/harfbuzz/src/hb-object.hh index 4b5bc32ade..f6c7a56991 100644 --- a/thirdparty/harfbuzz/src/hb-object.hh +++ b/thirdparty/harfbuzz/src/hb-object.hh @@ -222,8 +222,11 @@ static inline Type *hb_object_create () if (unlikely (!obj)) return obj; + new (obj) Type; + hb_object_init (obj); hb_object_trace (obj, HB_FUNC); + return obj; } template <typename Type> @@ -269,6 +272,9 @@ static inline bool hb_object_destroy (Type *obj) return false; hb_object_fini (obj); + + obj->~Type (); + return true; } template <typename Type> @@ -280,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> |