Always unmap mapped buffer.

Always unmap the mapped memory, even in case of exception.
This commit is contained in:
Jens Luetjen 2016-02-29 19:40:49 +01:00 committed by Thomas Adamcik
parent f0788515cd
commit 6faa19dbf3

View File

@ -57,8 +57,10 @@ gstreamer-GstTagList.html
buf = value.get_buffer()
(found, mapinfo) = buf.map(Gst.MapFlags.READ)
if found:
result[tag].append(bytes(mapinfo.data))
buf.unmap(mapinfo)
try:
result[tag].append(bytes(mapinfo.data))
finally:
buf.unmap(mapinfo)
else:
logger.log(
log.TRACE_LOG_LEVEL,