aboutsummaryrefslogtreecommitdiffstats
path: root/libaxl_detach.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-05-11 19:41:16 +0200
committerMattias Andrée <maandree@kth.se>2020-05-11 19:41:16 +0200
commit80bcfd86b16b990cac7c172d4f55740b27a1510b (patch)
treefbad87ac55543fc5f5563983b516325a1f9e07c6 /libaxl_detach.c
parentm (diff)
downloadlibaxl-80bcfd86b16b990cac7c172d4f55740b27a1510b.tar.gz
libaxl-80bcfd86b16b990cac7c172d4f55740b27a1510b.tar.bz2
libaxl-80bcfd86b16b990cac7c172d4f55740b27a1510b.tar.xz
Documentation, use of liberror, and implement libaxl_deallocate_id
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libaxl_detach.c')
-rw-r--r--libaxl_detach.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libaxl_detach.c b/libaxl_detach.c
index c4a0a21..72343a9 100644
--- a/libaxl_detach.c
+++ b/libaxl_detach.c
@@ -6,11 +6,16 @@ libaxl_detach(LIBAXL_CONNECTION *conn)
{
int fd = conn->fd;
LIBAXL_CONTEXT *ctx;
+ struct id_pool *pool, *next_pool;
while (conn->pending_out) {
ctx = conn->pending_out;
conn->pending_out = ctx->next_pending_out;
libaxl_context_free(ctx);
}
+ for (pool = atomic_load(&conn->xid_pool); pool; pool = next_pool) {
+ next_pool = pool->next;
+ free(pool);
+ }
free(conn->in_buf);
free(conn->info_buf);
free(conn);