Since struct l_genl is already refcounted we can hold references to the
l_genl object in an l_genl_family to allow the user to free them in
arbitrary order.
---
ell/genl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ell/genl.c b/ell/genl.c
index 431ed05..ca4fa62 100644
--- a/ell/genl.c
+++ b/ell/genl.c
@@ -1800,7 +1800,7 @@ LIB_EXPORT struct l_genl_family *l_genl_family_new(struct l_genl
*genl,
if (!entry)
return NULL;
- family = family_alloc(genl, info->id);
+ family = family_alloc(l_genl_ref(genl), info->id);
return family;
}
@@ -2059,4 +2059,5 @@ LIB_EXPORT void l_genl_family_free(struct l_genl_family *family)
}
l_free(family);
+ l_genl_unref(genl);
}
--
2.20.1