Always unmap mapped buffer.
Always unmap the mapped memory, even in case of exception.
This commit is contained in:
parent
f0788515cd
commit
6faa19dbf3
@ -57,7 +57,9 @@ gstreamer-GstTagList.html
|
|||||||
buf = value.get_buffer()
|
buf = value.get_buffer()
|
||||||
(found, mapinfo) = buf.map(Gst.MapFlags.READ)
|
(found, mapinfo) = buf.map(Gst.MapFlags.READ)
|
||||||
if found:
|
if found:
|
||||||
|
try:
|
||||||
result[tag].append(bytes(mapinfo.data))
|
result[tag].append(bytes(mapinfo.data))
|
||||||
|
finally:
|
||||||
buf.unmap(mapinfo)
|
buf.unmap(mapinfo)
|
||||||
else:
|
else:
|
||||||
logger.log(
|
logger.log(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user