summaryrefslogtreecommitdiff
path: root/accel-pppd/triton/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/triton/md.c')
-rw-r--r--accel-pppd/triton/md.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/accel-pppd/triton/md.c b/accel-pppd/triton/md.c
index c9ec32e..c97be45 100644
--- a/accel-pppd/triton/md.c
+++ b/accel-pppd/triton/md.c
@@ -100,6 +100,7 @@ static void *md_thread(void *arg)
while (!list_empty(&freed_list2)) {
h = list_entry(freed_list2.next, typeof(*h), entry);
list_del(&h->entry);
+ triton_context_release(h->ctx);
mempool_free(h);
}
@@ -125,6 +126,7 @@ void __export triton_md_register_handler(struct triton_context_t *ctx, struct tr
h->ctx = (struct _triton_context_t *)ctx->tpd;
else
h->ctx = (struct _triton_context_t *)default_ctx.tpd;
+ __sync_add_and_fetch(&h->ctx->refs, 1);
ud->tpd = h;
spin_lock(&h->ctx->lock);
list_add_tail(&h->entry, &h->ctx->handlers);