X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=748280af68b30fd6460e4df32135bf467c27a232;hp=6ad4037eb5828a5489ecc4a61e3386e644a9681c;hb=b144d63507bed89c551e3fdd74fe106c4d264fc2;hpb=e9dd2fea0514df9316a12bae191b810811fc9f01 diff --git a/decoder.c b/decoder.c index 6ad4037..748280a 100644 --- a/decoder.c +++ b/decoder.c @@ -39,7 +39,7 @@ /** @cond PRIVATE */ -/* The list of protocol decoders. */ +/* The list of loaded protocol decoders. */ static GSList *pd_list = NULL; /* srd.c */ @@ -64,7 +64,7 @@ static gboolean srd_check_init(void) } /** - * Returns the list of supported/loaded protocol decoders. + * Returns the list of loaded protocol decoders. * * This is a GSList of pointers to struct srd_decoder items. * @@ -704,7 +704,7 @@ SRD_API int srd_decoder_load(const char *module_name) if (get_binary_classes(d) != SRD_OK) goto err_out; - /* Append it to the list of supported/loaded decoders. */ + /* Append it to the list of loaded decoders. */ pd_list = g_slist_append(pd_list, d); return SRD_OK; @@ -787,6 +787,9 @@ SRD_API int srd_decoder_unload(struct srd_decoder *dec) srd_inst_free_all(sess, NULL); } + /* Remove the PD from the list of loaded decoders. */ + pd_list = g_slist_remove(pd_list, dec); + decoder_free(dec); return SRD_OK;