summaryrefslogtreecommitdiff
path: root/decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/decoder.c b/decoder.c
index 7374b77..260f636 100644
--- a/decoder.c
+++ b/decoder.c
@@ -1068,6 +1068,13 @@ SRD_API int srd_decoder_load_all(void)
return SRD_OK;
}
+static void srd_decoder_unload_cb(void *arg, void *ignored)
+{
+ (void)ignored;
+
+ srd_decoder_unload((struct srd_decoder *)arg);
+}
+
/**
* Unload all loaded protocol decoders.
*
@@ -1077,8 +1084,7 @@ SRD_API int srd_decoder_load_all(void)
*/
SRD_API int srd_decoder_unload_all(void)
{
- for (GSList *l = pd_list; l; l = l->next)
- srd_decoder_unload(l->data);
+ g_slist_foreach(pd_list, srd_decoder_unload_cb, NULL);
g_slist_free(pd_list);
pd_list = NULL;