Skip to content

Commit

Permalink
Close file handles
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanMarcus committed Jun 27, 2018
1 parent ce88b72 commit 72ed349
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion audioread/ffdec.py
Expand Up @@ -264,12 +264,14 @@ def close(self):
# ffmpeg closes normally on its own, but never updates
# `returncode`.
self.proc.poll()
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()
self.devnull.close()
self.devnull.close()

def __del__(self):
self.close()
Expand Down

0 comments on commit 72ed349

Please sign in to comment.