pad: fix sticky event leak after sticky_events_foreach
authorThiago Santos <ts.santos@sisa.samsung.com>
Sat, 18 Jan 2014 01:53:01 +0000 (22:53 -0300)
committerThiago Santos <ts.santos@sisa.samsung.com>
Sat, 18 Jan 2014 02:13:47 +0000 (23:13 -0300)
events_foreach adds an extra ref when giving the event to the
user function. In case it was unrefed by the user, this extra ref
disappeared, but events_foreach still should unref again to
lose its own ref before removing the event from the array.

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

gst/gstpad.c

index 516e6dd97b1b0e23129e10d17d08489fcebdf65f..794814b65491c638c70d61d1068cb564922ec801 100644 (file)
@@ -544,6 +544,7 @@ restart:
     if (G_UNLIKELY (ev->event != ev_ret.event)) {
       if (G_UNLIKELY (ev_ret.event == NULL)) {
         /* function unreffed and set the event to NULL, remove it */
+        gst_event_unref (ev->event);
         g_array_remove_index (events, i);
         len--;
         cookie = ++pad->priv->events_cookie;