From: Bert Vermeulen Date: Fri, 27 Jan 2012 07:22:19 +0000 (+0100) Subject: cli: correctly map probes on every instance, not just the last one. X-Git-Tag: sigrok-cli-0.3.0~55 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=67ce0d2757835e1c23967277631dac87a61a3f82;p=sigrok-cli.git cli: correctly map probes on every instance, not just the last one. --- diff --git a/sigrok-cli.c b/sigrok-cli.c index 271cf0e..1bf6c7d 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -495,14 +495,16 @@ static int register_pds(struct sr_device *device, const char *pdstring) goto err_out; } g_datalist_set_data(&pd_ann_visible, di->instance_id, pd_name); - } - /* Any keys left in the options hash are probes, where the key - * is the probe name as specified in the decoder class, and the - * value is the probe number i.e. the order in which the PD's - * incoming samples are arranged. */ - if (srd_instance_set_probes(di, pd_opthash) != SRD_OK) - return 1; + /* Any keys left in the options hash are probes, where the key + * is the probe name as specified in the decoder class, and the + * value is the probe number i.e. the order in which the PD's + * incoming samples are arranged. */ + if (srd_instance_set_probes(di, pd_opthash) != SRD_OK) + goto err_out; + g_hash_table_destroy(pd_opthash); + pd_opthash = NULL; + } err_out: g_strfreev(pdtokens);