[set/map] Fix uninitialized memory
I keep forgetting that primitive types are NOT initialized during construction. :|
This commit is contained in:
parent
ad3cededdd
commit
b186274362
@ -45,8 +45,8 @@ inline uint32_t Hash (const T &v)
|
|||||||
struct hb_map_t
|
struct hb_map_t
|
||||||
{
|
{
|
||||||
HB_NO_COPY_ASSIGN (hb_map_t);
|
HB_NO_COPY_ASSIGN (hb_map_t);
|
||||||
inline hb_map_t (void) { init_shallow (); }
|
inline hb_map_t (void) { init (); }
|
||||||
inline ~hb_map_t (void) { fini_shallow (); }
|
inline ~hb_map_t (void) { fini (); }
|
||||||
|
|
||||||
struct item_t
|
struct item_t
|
||||||
{
|
{
|
||||||
|
@ -272,6 +272,7 @@ static inline void hb_object_fini (Type *obj)
|
|||||||
{
|
{
|
||||||
user_data->fini ();
|
user_data->fini ();
|
||||||
free (user_data);
|
free (user_data);
|
||||||
|
user_data = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
struct hb_set_t
|
struct hb_set_t
|
||||||
{
|
{
|
||||||
HB_NO_COPY_ASSIGN (hb_set_t);
|
HB_NO_COPY_ASSIGN (hb_set_t);
|
||||||
inline hb_set_t (void) { init_shallow (); }
|
inline hb_set_t (void) { init (); }
|
||||||
inline ~hb_set_t (void) { fini_shallow (); }
|
inline ~hb_set_t (void) { fini (); }
|
||||||
|
|
||||||
struct page_map_t
|
struct page_map_t
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user