multiudpsink: Fix memory leak
authorOgnyan Tonchev <ognyan@axis.com>
Mon, 14 Oct 2013 14:23:25 +0000 (16:23 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Mon, 14 Oct 2013 16:21:54 +0000 (18:21 +0200)
Unmap all GstMemory of the current buffer when flushing.

https://bugzilla.gnome.org/show_bug.cgi?id=710110

gst/udp/gstmultiudpsink.c

index cb2674b..f180fb5 100644 (file)
@@ -638,6 +638,12 @@ flushing:
     g_mutex_unlock (&sink->client_lock);
     g_clear_error (&err);
 
+    /* unmap all memory */
+    for (i = 0; i < n_mem; i++) {
+      gst_memory_unmap (map[i].memory, &map[i]);
+      gst_memory_unref (map[i].memory);
+    }
+
     return GST_FLOW_FLUSHING;
   }
 }