From 67e588f382a05415852327096b06c45a0266e244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sun, 23 May 2021 20:43:31 +0200 Subject: [PATCH] filter-chain: actually use ladspa_handle_list Add successfully loaded handles to the list in `ladspa_handle_load()`, and remove them when they are freed in `ladspa_handle_unref()`. --- src/modules/module-filter-chain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index 454b91073..80c3d1215 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -756,8 +756,11 @@ static void ladspa_handle_unref(struct ladspa_handle *hndl) { if (--hndl->ref > 0) return; + if (hndl->handle) dlclose(hndl->handle); + + spa_list_remove(&hndl->link); free(hndl); } @@ -806,7 +809,9 @@ static struct ladspa_handle *ladspa_handle_load(struct impl *impl, const char *p res = -ENOSYS; goto exit; } + spa_list_init(&hndl->descriptor_list); + spa_list_append(&impl->ladspa_handle_list, &hndl->link); return hndl;