]> sigrok.org Git - libsigrok.git/blobdiff - src/device.c
Change SR_CONF_FILTER key to a boolean type.
[libsigrok.git] / src / device.c
index 2b6cda03bd9812a9969535c7792489d1bbe242e6..e7a0c4ffd277bf72c9a85b8946f37c13886df7ff 100644 (file)
@@ -247,6 +247,7 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int status,
 SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
 {
        struct sr_channel *ch;
+       struct sr_channel_group *cg;
        GSList *l;
 
        for (l = sdi->channels; l; l = l->next) {
@@ -257,8 +258,11 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
        }
        g_slist_free(sdi->channels);
 
-       if (sdi->channel_groups)
-               g_slist_free(sdi->channel_groups);
+       for (l = sdi->channel_groups; l; l = l->next) {
+               cg = l->data;
+               g_free(cg->priv);
+       }
+       g_slist_free(sdi->channel_groups);
 
        g_free(sdi->vendor);
        g_free(sdi->model);
@@ -550,6 +554,7 @@ SR_API const char *sr_dev_inst_sernum_get(struct sr_dev_inst *sdi)
        return sdi->serial_num;
 }
 
+#ifdef HAVE_LIBUSB_1_0
 /**
  * Queries a device instances' connection identifier.
  *
@@ -617,5 +622,6 @@ SR_API const char *sr_dev_inst_connid_get(struct sr_dev_inst *sdi)
 
        return sdi->connection_id;
 }
+#endif
 
 /** @} */