Skip to content
Browse files
BF: fixed a memory leak for MovieStim3
  • Loading branch information
peircej committed Aug 13, 2018
1 parent eadf758 commit 9d0c127d8e6dfd6efba5f285bed93685980cd443
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
@@ -999,7 +999,8 @@ def clearTextures(self):
of your stimulus, so doesn't need calling explicitly by the user.
GL.glDeleteTextures(1, self._texID)
GL.glDeleteTextures(1, self._maskID)
if hasattr(self, '_maskID'):
GL.glDeleteTextures(1, self._maskID)

def mask(self, value):
@@ -38,7 +38,7 @@
from psychopy import logging, prefs #adding prefs to be able to check sound lib -JK
from import val2array
from import logAttrib, setAttribute
from psychopy.visual.basevisual import BaseVisualStim, ContainerMixin
from psychopy.visual.basevisual import BaseVisualStim, ContainerMixin, TextureMixin

from import VideoFileClip

@@ -50,7 +50,7 @@
import as GL

class MovieStim3(BaseVisualStim, ContainerMixin):
class MovieStim3(BaseVisualStim, ContainerMixin, TextureMixin):
"""A stimulus class for playing movies (mpeg, avi, etc...) in PsychoPy
that does not require avbin. Instead it requires the cv2 python package
for OpenCV. The VLC media player also needs to be installed on the
@@ -467,11 +467,8 @@ def _getAudioStreamTime(self):
return self._audio_stream_clock.getTime()

def _unload(self):
# remove textures from graphics card to prevent crash
except Exception:
# remove textures from graphics card to prevent crash
if self._mov is not None:
self._mov = None

0 comments on commit 9d0c127

Please sign in to comment.