Commit 40b00998 authored by Jerome Flesch's avatar Jerome Flesch

Sane: sane_cancel() must always be called at the end of all scans, even if the...

Sane: sane_cancel() must always be called at the end of all scans, even if the scan was done up to the end.
Most the backends tolerate sane_cancel() not being called, but not the backend 'brother'
Signed-off-by: Jerome Flesch's avatarJerome Flesch <jflesch@openpaper.work>
parent 4542e192
......@@ -1120,6 +1120,7 @@ static enum lis_error lis_sane_scan_start(struct lis_item *self,
sane_err);
private->session.end_of_page = 1;
private->session.end_of_feed = 1;
sane_cancel(private->handle);
return LIS_OK;
}
lis_log_info("Sane: scan_start() OK");
......@@ -1184,6 +1185,7 @@ static enum lis_error lis_sane_scan_read(
lis_log_warning("sane_start() returned EOF (%d) --> No document in the feeder",
sane_err);
private->end_of_feed = 1;
sane_cancel(private->item->handle);
return LIS_OK;
}
......@@ -1197,6 +1199,7 @@ static enum lis_error lis_sane_scan_read(
lis_log_warning("sane_start() failed: 0x%X, %s (assuming end of feed)",
err, lis_strerror(err));
private->end_of_feed = 1;
sane_cancel(private->item->handle);
}
return LIS_OK;
case SANE_STATUS_NO_DOCS:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment