Close file descriptors to prevent memory leaks

This commit is contained in:
Roberto Rosario
2011-03-07 23:22:53 -04:00
parent 41161b2ad7
commit e4912a8d4d

View File

@@ -35,7 +35,7 @@ def run_tesseract(input_filename, output_filename_base, lang=None):
if lang is not None:
command += ['-l', lang]
proc = subprocess.Popen(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
proc = subprocess.Popen(command, close_fds=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
return_code = proc.wait()
if return_code != 0:
error_text = proc.stderr.read()