camerabin2: secure event ref when sending event to parent class

camerabin2 needs to hold an extra ref on send_event before sending
it to the parent class as it will need to use it after the parent
handles it.
This commit is contained in:
Thiago Santos 2011-12-27 10:20:48 -03:00
parent ce1c741f37
commit 399ec70a08

View file

@ -1964,6 +1964,9 @@ gst_camera_bin_send_event (GstElement * element, GstEvent * event)
GstCameraBin2 *camera = GST_CAMERA_BIN2_CAST (element);
gboolean res;
/* avoid losing our ref to send_event */
gst_event_ref (event);
res = GST_ELEMENT_CLASS (parent_class)->send_event (element, event);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
@ -1989,6 +1992,7 @@ gst_camera_bin_send_event (GstElement * element, GstEvent * event)
break;
}
gst_event_unref (event);
return res;
}