Skip to content

Commit

Permalink
Merge pull request #501 from gyglim/fix_open_pipe
Browse files Browse the repository at this point in the history
Fix for cleaning up os calls through Popen
  • Loading branch information
bearney74 committed Mar 17, 2017
2 parents d633510 + f612a45 commit 3b9bf7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions moviepy/audio/io/AudioFileClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,10 @@ def coreader(self):
to the audio file. Use copy when you have different clips
watching the audio file at different times. """
return AudioFileClip(self.filename,self.buffersize)

def __del__(self):
""" Close/delete the internal reader. """
try:
del self.reader
except AttributeError:
pass
5 changes: 5 additions & 0 deletions moviepy/video/io/VideoFileClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,8 @@ def __del__(self):
del self.reader
except AttributeError:
pass

try:
del self.audio
except AttributeError:
pass

0 comments on commit 3b9bf7a

Please sign in to comment.