Don't close the child item.

A v4l device may become unusable after the first capture (its child source
item may have been faked by libinsane if it had none).

Real scanners sustain both situations so far, i.e., whether the child source
is explicitly closed or not.
This commit is contained in:
Saleem Edah-Tally
2025-07-01 17:48:21 +02:00
parent ef6f25ef27
commit 554b3606cd

View File

@@ -434,7 +434,12 @@ bool InsaneWorker::Scan(const std::string& dir, const std::string& basename,
if (m_evh)
m_evh->OnEndScanSession(pageIndex - increment, imageAttributes);
m_rootSourceItem->close(m_sourceItem); // Child.
/*
* Don't close the child item.
* A v4l device may become unusable after the first capture (its child source
* item may have been faked by libinsane if it had none).
* Real scanners sustain both situations so far.
*/
m_rootSourceItem->close(m_rootSourceItem); // Root.
return true;
}