Don't lock user_data set during destruction if empty

This commit is contained in:
Behdad Esfahbod 2012-07-30 10:06:42 -04:00
parent 4ba647eecf
commit 3f4764bb56
1 changed files with 5 additions and 0 deletions

View File

@ -442,6 +442,11 @@ struct hb_lockable_set_t
inline void finish (lock_t &l) inline void finish (lock_t &l)
{ {
if (!items.len) {
/* No need for locking. */
items.finish ();
return;
}
l.lock (); l.lock ();
while (items.len) { while (items.len) {
item_t old = items[items.len - 1]; item_t old = items[items.len - 1];