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,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(