mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 00:11:14 +01:00
[map] Destruct objects when clearing
This commit is contained in:
1 parent
4caad5720c
commit
99103bd976
1 file changed
+7
-1
+7
-1
@@ -96,6 +96,12 @@ struct hb_hashmap_t
|
||||
is_used_ = false;
|
||||
is_tombstone_ = false;
|
||||
}
|
||||
void reconstruct ()
|
||||
{
|
||||
key.~K ();
|
||||
value.~V ();
|
||||
construct ();
|
||||
}
|
||||
|
||||
bool operator == (const K &o) { return hb_deref (key) == hb_deref (o); }
|
||||
bool operator == (const item_t &o) { return *this == o.key; }
|
||||
@@ -237,7 +243,7 @@ struct hb_hashmap_t
|
||||
if (unlikely (!successful)) return;
|
||||
|
||||
for (auto &_ : hb_iter (items, mask ? mask + 1 : 0))
|
||||
_.construct ();
|
||||
_.reconstruct ();
|
||||
|
||||
population = occupancy = 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user