aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libabc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libabc.c b/src/libabc.c
index d6ef0b4..21e434b 100644
--- a/src/libabc.c
+++ b/src/libabc.c
@@ -251,6 +251,7 @@ ABC_EXPORT struct abc_thing *abc_thing_unref(struct abc_thing *thing)
if (thing->refcount > 0)
return NULL;
dbg(thing->ctx, "context %p released\n", thing);
+ abc_unref(thing->ctx);
free(thing);
return NULL;
}
@@ -269,7 +270,7 @@ ABC_EXPORT int abc_thing_new_from_string(struct abc_ctx *ctx, const char *string
return -ENOMEM;
t->refcount = 1;
- t->ctx = ctx;
+ t->ctx = abc_ref(ctx);
*thing = t;
return 0;
}