From 3f4764bb56bb7e42ba8859f1905810bd2f998838 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 30 Jul 2012 10:06:42 -0400 Subject: [PATCH] Don't lock user_data set during destruction if empty --- src/hb-private.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hb-private.hh b/src/hb-private.hh index ea3254c..2f85025 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -442,6 +442,11 @@ struct hb_lockable_set_t inline void finish (lock_t &l) { + if (!items.len) { + /* No need for locking. */ + items.finish (); + return; + } l.lock (); while (items.len) { item_t old = items[items.len - 1]; -- 2.7.4