{
struct drv_context *drvc;
struct sr_dev_inst *sdi;
- GSList *l;
+ struct sr_channel_group *cg;
+ GSList *l, *lcg;
int ret;
if (!(drvc = driver->priv))
sr_scpi_free(sdi->conn);
}
if (clear_private)
+ /* The helper function is responsible for freeing
+ * its own sdi->priv! */
clear_private(sdi->priv);
else
g_free(sdi->priv);
+
+ /* Channel groups */
+ for (lcg = sdi->channel_groups; lcg; lcg = lcg->next) {
+ cg = lcg->data;
+ g_free(cg->name);
+ g_slist_free(cg->channels);
+ g_free(cg);
+ }
sr_dev_inst_free(sdi);
}