xvimagesink: fix navigation event leak when early returning

Create the event *after* the early return check so it's not leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=748903
This commit is contained in:
Guillaume Desmottes 2015-05-04 17:59:30 +02:00 committed by Thiago Santos
parent 9d85e23c3d
commit ca100d117c

View file

@ -1137,8 +1137,6 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
gdouble x, y, xscale = 1.0, yscale = 1.0; gdouble x, y, xscale = 1.0, yscale = 1.0;
GstXWindow *xwindow; GstXWindow *xwindow;
event = gst_event_new_navigation (structure);
/* We take the flow_lock while we look at the window */ /* We take the flow_lock while we look at the window */
g_mutex_lock (&xvimagesink->flow_lock); g_mutex_lock (&xvimagesink->flow_lock);
@ -1183,6 +1181,7 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
(gdouble) y * yscale, NULL); (gdouble) y * yscale, NULL);
} }
event = gst_event_new_navigation (structure);
gst_event_ref (event); gst_event_ref (event);
handled = gst_pad_send_event (peer, event); handled = gst_pad_send_event (peer, event);
gst_object_unref (peer); gst_object_unref (peer);