From 399ec70a087b9646bd888a8841efd8290690fc38 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 27 Dec 2011 10:20:48 -0300 Subject: [PATCH] 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. --- gst/camerabin2/gstcamerabin2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 275b8d5..ce61f1d 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -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; } -- 2.7.4