From: Bert Vermeulen Date: Thu, 31 Oct 2013 21:53:22 +0000 (+0100) Subject: rigol-ds1xx2: fix bitrot in device cleanup code X-Git-Tag: libsigrok-0.3.0~576 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ba358ffd83810fe0c03248992b9076fb435f7b4b;p=libsigrok.git rigol-ds1xx2: fix bitrot in device cleanup code --- diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 289178f5..e4413807 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -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)