diff --git a/lib/templates/detect_fields.rb b/lib/templates/detect_fields.rb index 20bb9e3f..d9a81180 100755 --- a/lib/templates/detect_fields.rb +++ b/lib/templates/detect_fields.rb @@ -87,7 +87,11 @@ module Templates yield [attachment&.uuid, page_number, fields] if block_given? fields + ensure + page.close end + ensure + doc.close end def extract_line_fields_from_page(page)