aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-17 15:49:09 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:06:09 -0500
commitf09537ca61cdef6920ff3aeacba75521670a9acd (patch)
tree53cd298dedb2adb45236f6787609fe190e7333a3 /src
parent7598701248587c911b7f4e9fbfce601bb9514863 (diff)
downloadjalv-f09537ca61cdef6920ff3aeacba75521670a9acd.tar.gz
jalv-f09537ca61cdef6920ff3aeacba75521670a9acd.tar.bz2
jalv-f09537ca61cdef6920ff3aeacba75521670a9acd.zip
Factor out jalv_free_nodes()
Diffstat (limited to 'src')
-rw-r--r--src/jalv.c4
-rw-r--r--src/nodes.c8
-rw-r--r--src/nodes.h3
3 files changed, 12 insertions, 3 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 8906d23..4f9d4f6 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -1212,9 +1212,7 @@ jalv_close(Jalv* const jalv)
zix_free(NULL, jalv->ui_msg);
zix_free(NULL, jalv->audio_msg);
free(jalv->controls_buf);
- for (LilvNode** n = (LilvNode**)&jalv->nodes; *n; ++n) {
- lilv_node_free(*n);
- }
+ jalv_free_nodes(&jalv->nodes);
#if USE_SUIL
suil_host_free(jalv->ui_host);
#endif
diff --git a/src/nodes.c b/src/nodes.c
index 8d6e409..32ffa71 100644
--- a/src/nodes.c
+++ b/src/nodes.c
@@ -66,3 +66,11 @@ jalv_init_nodes(LilvWorld* const world, JalvNodes* const nodes)
#undef MAP_NODE
}
+
+void
+jalv_free_nodes(JalvNodes* const nodes)
+{
+ for (LilvNode** n = (LilvNode**)nodes; *n; ++n) {
+ lilv_node_free(*n);
+ }
+}
diff --git a/src/nodes.h b/src/nodes.h
index 61deedc..60ffe36 100644
--- a/src/nodes.h
+++ b/src/nodes.h
@@ -58,6 +58,9 @@ typedef struct {
void
jalv_init_nodes(LilvWorld* world, JalvNodes* nodes);
+void
+jalv_free_nodes(JalvNodes* nodes);
+
JALV_END_DECLS
#endif // JALV_NODES_H