From: Soeren Apel Date: Wed, 13 Aug 2014 14:33:38 +0000 (+0200) Subject: hameg-hmo: Make sure the enabled_channels list is empty before populating it X-Git-Tag: libsigrok-0.4.0~1149 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=db81fbb58261825e03aadaf20cff794e4c65401a;p=libsigrok.git hameg-hmo: Make sure the enabled_channels list is empty before populating it Previous runs of dev_acquisition_start() keep the enabled_channels list populated if they fail. This means that once an invalid channel configuration was detected, it will be detected again even if the channel configuration was changed. With this change, the list will be cleared before being populated so that any stale entries are removed. --- diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index c3d70059..7f3d5f54 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -727,6 +727,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) devc = sdi->priv; digital_added = FALSE; + g_slist_free(devc->enabled_channels); + devc->enabled_channels = NULL; + for (l = sdi->channels; l; l = l->next) { ch = l->data; if (!ch->enabled)