diff --git a/hash_table.h b/hash_table.h index e064af1..951bd2d 100644 --- a/hash_table.h +++ b/hash_table.h @@ -199,6 +199,7 @@ static int PREFIX(_table_resize)(PREFIX(_table) *table) __sync_synchronize(); table->old = NULL; # if !defined(ENABLE_GC) && defined(MAP_TABLE_SINGLE_THREAD) + free(copy->table); free(copy); # endif return 1; diff --git a/selector_table.c b/selector_table.c index d75e1c4..c2629cf 100644 --- a/selector_table.c +++ b/selector_table.c @@ -211,6 +211,7 @@ static inline uint32_t hash_selector(const void *s) } #define MAP_TABLE_NAME selector +#define MAP_TABLE_SINGLE_THREAD #define MAP_TABLE_COMPARE_FUNCTION selector_identical #define MAP_TABLE_HASH_KEY hash_selector #define MAP_TABLE_HASH_VALUE hash_selector @@ -245,6 +246,7 @@ PRIVATE void init_selector_tables() static SEL selector_lookup(const char *name, const char *types) { struct objc_selector sel = {{name}, types}; + LOCK_FOR_SCOPE(&selector_table_lock); return selector_table_get(sel_table, &sel); } static inline void add_selector_to_table(SEL aSel, int32_t uid, uint32_t idx)