rigol-ds1xx2: fix bitrot in device cleanup code

This commit is contained in:
Bert Vermeulen 2013-10-31 22:53:22 +01:00 committed by Uwe Hermann
parent e43fdd8d4f
commit ba358ffd83
1 changed files with 4 additions and 23 deletions

View File

@ -149,33 +149,14 @@ static void clear_helper(void *priv)
{
struct dev_context *devc;
for (l = drvc->instances; l; l = l->next) {
if (!(sdi = l->data))
continue;
if (sdi->conn)
sr_serial_dev_inst_free(sdi->conn);
g_slist_free(sdi->probe_groups);
if (!(devc = sdi->priv))
continue;
g_free(devc->coupling[0]);
g_free(devc->coupling[1]);
g_free(devc->trigger_source);
g_free(devc->trigger_slope);
g_slist_free(devc->analog_groups[0].probes);
g_slist_free(devc->analog_groups[1].probes);
g_slist_free(devc->digital_group.probes);
sr_dev_inst_free(sdi);
}
devc = priv;
g_free(devc->coupling[0]);
g_free(devc->coupling[1]);
g_free(devc->trigger_source);
g_free(devc->trigger_slope);
g_slist_free(devc->analog_groups[0].probes);
g_slist_free(devc->analog_groups[1].probes);
g_slist_free(devc->digital_group.probes);
}
static int dev_clear(void)