Gst.py: unref __parent__ on unmap otherwise it cause a memory leak
authorJose Quaresma <quaresma.jose@gmail.com>
Sun, 14 Jun 2020 15:48:45 +0000 (16:48 +0100)
committerJose Quaresma <quaresma.jose@gmail.com>
Fri, 10 Jul 2020 16:08:03 +0000 (17:08 +0100)
gi/overrides/Gst.py

index c62d9e1..e7eeb29 100644 (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)