From 554b3606cda33c10eb83d1451eb99769a3fa17e5 Mon Sep 17 00:00:00 2001 From: Saleem Edah-Tally Date: Tue, 1 Jul 2025 17:48:21 +0200 Subject: [PATCH] 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. --- Resources/InsaneWidget/InsaneWorker.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Resources/InsaneWidget/InsaneWorker.cpp b/Resources/InsaneWidget/InsaneWorker.cpp index 4c66c83..7a06519 100644 --- a/Resources/InsaneWidget/InsaneWorker.cpp +++ b/Resources/InsaneWidget/InsaneWorker.cpp @@ -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; }