diff options
Diffstat (limited to 'src/charon/config/connections/local_connection_store.c')
-rw-r--r-- | src/charon/config/connections/local_connection_store.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/charon/config/connections/local_connection_store.c b/src/charon/config/connections/local_connection_store.c index 8748fb730..30e7e9c8a 100644 --- a/src/charon/config/connections/local_connection_store.c +++ b/src/charon/config/connections/local_connection_store.c @@ -215,14 +215,8 @@ static iterator_t* create_iterator(private_local_connection_store_t *this) */ static void destroy (private_local_connection_store_t *this) { - connection_t *connection; - pthread_mutex_lock(&(this->mutex)); - while (this->connections->remove_last(this->connections, (void**)&connection) == SUCCESS) - { - connection->destroy(connection); - } - this->connections->destroy(this->connections); + this->connections->destroy_offset(this->connections, offsetof(connection_t, destroy)); pthread_mutex_unlock(&(this->mutex)); free(this); } |