mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
examples: webrtc: Remove the bus watch at the end
Otherwise a file descriptor will be leaked. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3609>
This commit is contained in:
parent
1f4f338d85
commit
ec6290d63f
3 changed files with 17 additions and 0 deletions
|
@ -973,6 +973,7 @@ int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GOptionContext *context;
|
GOptionContext *context;
|
||||||
|
GstBus *bus;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
context = g_option_context_new ("- gstreamer webrtc sendrecv demo");
|
context = g_option_context_new ("- gstreamer webrtc sendrecv demo");
|
||||||
|
@ -1021,6 +1022,10 @@ main (int argc, char *argv[])
|
||||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
||||||
gst_print ("Pipeline stopped\n");
|
gst_print ("Pipeline stopped\n");
|
||||||
|
|
||||||
|
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
||||||
|
gst_bus_remove_watch (bus);
|
||||||
|
gst_object_unref (bus);
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
g_free (server_url);
|
g_free (server_url);
|
||||||
g_free (local_id);
|
g_free (local_id);
|
||||||
|
|
|
@ -392,9 +392,15 @@ destroy_receiver_entry (gpointer receiver_entry_ptr)
|
||||||
g_assert (receiver_entry != NULL);
|
g_assert (receiver_entry != NULL);
|
||||||
|
|
||||||
if (receiver_entry->pipeline != NULL) {
|
if (receiver_entry->pipeline != NULL) {
|
||||||
|
GstBus *bus;
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (receiver_entry->pipeline),
|
gst_element_set_state (GST_ELEMENT (receiver_entry->pipeline),
|
||||||
GST_STATE_NULL);
|
GST_STATE_NULL);
|
||||||
|
|
||||||
|
bus = gst_pipeline_get_bus (GST_PIPELINE (receiver_entry->pipeline));
|
||||||
|
gst_bus_remove_watch (bus);
|
||||||
|
gst_object_unref (bus);
|
||||||
|
|
||||||
gst_object_unref (GST_OBJECT (receiver_entry->webrtcbin));
|
gst_object_unref (GST_OBJECT (receiver_entry->webrtcbin));
|
||||||
gst_object_unref (GST_OBJECT (receiver_entry->pipeline));
|
gst_object_unref (GST_OBJECT (receiver_entry->pipeline));
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,9 +324,15 @@ destroy_receiver_entry (gpointer receiver_entry_ptr)
|
||||||
g_assert (receiver_entry != NULL);
|
g_assert (receiver_entry != NULL);
|
||||||
|
|
||||||
if (receiver_entry->pipeline != NULL) {
|
if (receiver_entry->pipeline != NULL) {
|
||||||
|
GstBus *bus;
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (receiver_entry->pipeline),
|
gst_element_set_state (GST_ELEMENT (receiver_entry->pipeline),
|
||||||
GST_STATE_NULL);
|
GST_STATE_NULL);
|
||||||
|
|
||||||
|
bus = gst_pipeline_get_bus (GST_PIPELINE (receiver_entry->pipeline));
|
||||||
|
gst_bus_remove_watch (bus);
|
||||||
|
gst_object_unref (bus);
|
||||||
|
|
||||||
gst_object_unref (GST_OBJECT (receiver_entry->webrtcbin));
|
gst_object_unref (GST_OBJECT (receiver_entry->webrtcbin));
|
||||||
gst_object_unref (GST_OBJECT (receiver_entry->pipeline));
|
gst_object_unref (GST_OBJECT (receiver_entry->pipeline));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue