mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 05:56:31 +00:00
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:
parent
ce1c741f37
commit
399ec70a08
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue