]> sigrok.org Git - libsigrok.git/blobdiff - std.c
Route sr_source_remove for all serial devices through a wrapper.
[libsigrok.git] / std.c
diff --git a/std.c b/std.c
index 44435be22520745d460dc66ffe4d64a80449568c..7837d35a3c32f95f0bcabbca69c1655d1b67f675 100644 (file)
--- a/std.c
+++ b/std.c
@@ -143,7 +143,7 @@ SR_PRIV int std_dev_acquisition_stop_serial(struct sr_dev_inst *sdi,
 
        sr_dbg("%sStopping acquisition.", prefix);
 
-       if ((ret = sr_source_remove(serial->fd)) < 0) {
+       if ((ret = serial_source_remove(serial)) < 0) {
                sr_err("%sFailed to remove source: %d.", prefix, ret);
                return ret;
        }
@@ -215,6 +215,8 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
                        if (sdi->inst_type == SR_INST_USB)
                                sr_usb_dev_inst_free(sdi->conn);
 #endif
+                       if (sdi->inst_type == SR_INST_SCPI)
+                               sr_scpi_free(sdi->conn);
                }
                if (clear_private)
                        clear_private(sdi->priv);