Gst.py: unref __parent__ on unmap otherwise it cause a memory leak

This commit is contained in:
Jose Quaresma 2020-06-14 16:48:45 +01:00
parent 9a31b01486
commit bea8e5c6ca

View file

@ -631,6 +631,7 @@ class Buffer(Gst.Buffer):
raise MapError('MappingError','Buffer mapping was not successfull')
def unmap(self, mapinfo):
mapinfo.__parent__ = None
if _gi_gst.buffer_override_unmap(self, mapinfo) is not True:
raise MapError('UnmappingError','Buffer unmapping was not successfull')
@ -647,6 +648,7 @@ class Memory(Gst.Memory):
raise MapError('MappingError','Memory mapping was not successfull')
def unmap(self, mapinfo):
mapinfo.__parent__ = None
return _gi_gst.memory_override_unmap(self, mapinfo)
Memory = override(Memory)