X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=76f8682ad98a9d189287093511c5aa602f6f1027;hp=5eac220a55c5b0a2942963700dce6700efa19f11;hb=7529cdaad9e9a52c93ed4d21c2fcccaf3313592c;hpb=ca3fc3c0c042ecf509f8218e417655c04c9b9831 diff --git a/decoder.c b/decoder.c index 5eac220..76f8682 100644 --- a/decoder.c +++ b/decoder.c @@ -42,6 +42,8 @@ /* The list of protocol decoders. */ SRD_PRIV GSList *pd_list = NULL; +extern GSList *sessions; + /* module_sigrokdecode.c */ extern SRD_PRIV PyObject *mod_sigrokdecode; @@ -461,6 +463,7 @@ static void free_probes(GSList *probelist) SRD_API int srd_decoder_unload(struct srd_decoder *dec) { struct srd_decoder_option *o; + struct srd_session *sess; GSList *l; srd_dbg("Unloading protocol decoder '%s'.", dec->name); @@ -471,7 +474,10 @@ SRD_API int srd_decoder_unload(struct srd_decoder *dec) * stack. A frontend reloading a decoder thus has to restart all * instances, and rebuild the stack. */ - srd_inst_free_all(NULL); + for (l = sessions; l; l = l->next) { + sess = l->data; + srd_inst_free_all(sess, NULL); + } for (l = dec->options; l; l = l->next) { o = l->data;