rigol-ds: close SCPI device after using for scan.

This commit is contained in:
Martin Ling 2013-12-07 17:54:33 +00:00
parent 721fc2272e
commit b4936bae0a
1 changed files with 3 additions and 0 deletions

View 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;