Free channel group private storage when clearing device instance.
This commit is contained in:
parent
c7c8994c20
commit
b1b1944e19
|
@ -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)
|
SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
|
||||||
{
|
{
|
||||||
struct sr_channel *ch;
|
struct sr_channel *ch;
|
||||||
|
struct sr_channel_group *cg;
|
||||||
GSList *l;
|
GSList *l;
|
||||||
|
|
||||||
for (l = sdi->channels; l; l = l->next) {
|
for (l = sdi->channels; l; l = l->next) {
|
||||||
|
@ -257,7 +258,10 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
|
||||||
}
|
}
|
||||||
g_slist_free(sdi->channels);
|
g_slist_free(sdi->channels);
|
||||||
|
|
||||||
if (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_slist_free(sdi->channel_groups);
|
||||||
|
|
||||||
g_free(sdi->vendor);
|
g_free(sdi->vendor);
|
||||||
|
|
Loading…
Reference in New Issue