Skip to content

Fix second finishing of page during batch scans

George Matsumura requested to merge Gorg/simple-scan:batch_page_fix into master

When scanning multiple pages from a flatbed scanner as part of a batch job, the debug output printed for each page contains: [+128.71s] CRITICAL: page_finish: assertion 'self != NULL' failed

page_finish is called in response to the event NotifyPageDone, which in turn calls the function scanner_page_done_cb. scanner_page_done_cb sets scanned_page to NULL, and therefore cannot be correctly called twice for the same job unless scanned_page is reset between each call. This change fixes this behaviour.

This may be related to the errors seen in #94, although I doubt it fixes the underlying issue.

Thank you for looking at this. If there is anything I can do to improve this, please let me know.

Merge request reports