]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds1xx2: fix bitrot in device cleanup code
authorBert Vermeulen <redacted>
Thu, 31 Oct 2013 21:53:22 +0000 (22:53 +0100)
committerUwe Hermann <redacted>
Fri, 8 Nov 2013 00:03:18 +0000 (01:03 +0100)
hardware/rigol-ds1xx2/api.c

index 289178f5eef0a322c549f5db1e87da2f946d5753..e441380784093d1313ac98ac2854f18bf8fbc541 100644 (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)