summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--btcore/src/counter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/btcore/src/counter.c b/btcore/src/counter.c
index b88c7a27e..92248b237 100644
--- a/btcore/src/counter.c
+++ b/btcore/src/counter.c
@@ -136,7 +136,9 @@ static future_t *counter_init(void) {
static future_t *counter_clean_up(void) {
counter_socket_close();
+ pthread_mutex_lock(&hash_map_lock_);
hash_map_free(hash_map_counter_);
+ pthread_mutex_unlock(&hash_map_lock_);
pthread_mutex_destroy(&hash_map_lock_);
hash_map_counter_ = NULL;
return future_new_immediate(FUTURE_SUCCESS);