Skip to content

Commit

Permalink
added comments and fixed paragraphing
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanMarcus committed Jun 27, 2018
1 parent 72ed349 commit feb02c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions audioread/ffdec.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,18 @@ def close(self):
# ffmpeg closes normally on its own, but never updates
# `returncode`.
self.proc.poll()

# Close the stdout and stderr streams that were opened by Popen.
self.proc.stdout.close()
self.proc.stderr.close()

# Kill the process if it is still running.
if self.proc.returncode is None:
self.proc.kill()
self.proc.wait()

# Close the handle to os.devnull, which is opened regardless of if
# a subprocess is successfully created
self.devnull.close()

def __del__(self):
Expand Down

0 comments on commit feb02c1

Please sign in to comment.