]> sigrok.org Git - sigrok-cli.git/commitdiff
cli: correctly map probes on every instance, not just the last one.
authorBert Vermeulen <redacted>
Fri, 27 Jan 2012 07:22:19 +0000 (08:22 +0100)
committerBert Vermeulen <redacted>
Fri, 27 Jan 2012 07:22:19 +0000 (08:22 +0100)
sigrok-cli.c

index 271cf0e545ec2301b8f7be6e6dc478e398e3bf42..1bf6c7d801d40770f99f1d075ed0d251925abf5e 100644 (file)
@@ -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);
                        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);
 
 err_out:
        g_strfreev(pdtokens);