diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh index e3c9d2114..8a2cdb617 100644 --- a/src/hb-object-private.hh +++ b/src/hb-object-private.hh @@ -80,6 +80,8 @@ struct hb_user_data_array_t hb_lockable_set_t items; + inline void init (void) { items.init (); } + HB_INTERNAL bool set (hb_user_data_key_t *key, void * data, hb_destroy_func_t destroy, @@ -111,6 +113,7 @@ struct hb_object_header_t inline void init (void) { ref_count.init (1); + user_data.init (); } inline bool is_inert (void) const { diff --git a/src/hb-private.hh b/src/hb-private.hh index aa86072b0..d18b8fb80 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -247,7 +247,7 @@ struct hb_prealloced_array_t { Type *array; Type static_array[StaticSize]; - hb_prealloced_array_t (void) { memset (this, 0, sizeof (*this)); } + void init (void) { memset (this, 0, sizeof (*this)); } inline Type& operator [] (unsigned int i) { return array[i]; } inline const Type& operator [] (unsigned int i) const { return array[i]; } @@ -351,6 +351,8 @@ struct hb_lockable_set_t { hb_array_t items; + inline void init (void) { items.init (); } + template inline item_t *replace_or_insert (T v, lock_t &l, bool replace) { diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh index 9d8ba4a5a..b8407e927 100644 --- a/src/hb-set-private.hh +++ b/src/hb-set-private.hh @@ -37,6 +37,7 @@ struct _hb_set_t { inline void init (void) { + header.init (); clear (); } inline void fini (void) {