]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: close SCPI device after using for scan.
authorMartin Ling <redacted>
Sat, 7 Dec 2013 17:54:33 +0000 (17:54 +0000)
committerMartin Ling <redacted>
Sat, 7 Dec 2013 19:43:47 +0000 (19:43 +0000)
hardware/rigol-ds/api.c

index 8af03eb6970626e3482d3ef1d2b51cc7fafe179a..6b92fa8de091ec5a943402fc6a8bd25f0a754abe 100644 (file)
@@ -279,6 +279,7 @@ static int probe_port(const char *resource, const char *serialcomm, GSList **dev
 
        if (strcasecmp(hw_info->manufacturer, "Rigol Technologies")) {
                sr_scpi_hw_info_free(hw_info);
+               sr_scpi_close(scpi);
                sr_scpi_free(scpi);
                return SR_ERR_NA;
        }
@@ -294,11 +295,13 @@ static int probe_port(const char *resource, const char *serialcomm, GSList **dev
                                              hw_info->manufacturer, hw_info->model,
                                                  hw_info->firmware_version))) {
                sr_scpi_hw_info_free(hw_info);
+               sr_scpi_close(scpi);
                sr_scpi_free(scpi);
                return SR_ERR_NA;
        }
 
        sr_scpi_hw_info_free(hw_info);
+       sr_scpi_close(scpi);
 
        sdi->conn = scpi;