Skip to content
Permalink
Browse files

fix(subprocess): close stdout and stderr to avoid memory leak

  • Loading branch information...
numb3r3 committed Sep 20, 2019
1 parent 205962f commit 780aad0dca93578f76d7372db822fc4599f133b9
Showing with 8 additions and 1 deletion.
  1. +8 −1 gnes/preprocessor/io_utils/helper.py
@@ -45,7 +45,8 @@ def run_command_async(cmd_args,
cmd_args,
stdin=stdin_stream,
stdout=stdout_stream,
stderr=stderr_stream)
stderr=stderr_stream,
close_fds=True)


def wait(process):
@@ -76,4 +77,10 @@ def run_command(cmd_args,

if retcode:
raise Exception('ffmpeg error: %s' % stderr)

if proc.stdout is not None:
proc.stdout.close()
if proc.stderr is not None:
proc.stderr.close()

return stdout, stderr

0 comments on commit 780aad0

Please sign in to comment.
You can’t perform that action at this time.