diff --git a/subprojects/gst-examples/webrtc/multiparty-sendrecv/gst/mp-webrtc-sendrecv.c b/subprojects/gst-examples/webrtc/multiparty-sendrecv/gst/mp-webrtc-sendrecv.c index a184e19ff7..30f49628d6 100644 --- a/subprojects/gst-examples/webrtc/multiparty-sendrecv/gst/mp-webrtc-sendrecv.c +++ b/subprojects/gst-examples/webrtc/multiparty-sendrecv/gst/mp-webrtc-sendrecv.c @@ -973,6 +973,7 @@ int main (int argc, char *argv[]) { GOptionContext *context; + GstBus *bus; GError *error = NULL; 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_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); g_free (server_url); g_free (local_id); diff --git a/subprojects/gst-examples/webrtc/sendonly/webrtc-recvonly-h264.c b/subprojects/gst-examples/webrtc/sendonly/webrtc-recvonly-h264.c index 0533f083de..58dbf02798 100644 --- a/subprojects/gst-examples/webrtc/sendonly/webrtc-recvonly-h264.c +++ b/subprojects/gst-examples/webrtc/sendonly/webrtc-recvonly-h264.c @@ -392,9 +392,15 @@ destroy_receiver_entry (gpointer receiver_entry_ptr) g_assert (receiver_entry != NULL); if (receiver_entry->pipeline != NULL) { + GstBus *bus; + gst_element_set_state (GST_ELEMENT (receiver_entry->pipeline), 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->pipeline)); } diff --git a/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c b/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c index 4717b6abb1..5d6ed259b7 100644 --- a/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c +++ b/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c @@ -324,9 +324,15 @@ destroy_receiver_entry (gpointer receiver_entry_ptr) g_assert (receiver_entry != NULL); if (receiver_entry->pipeline != NULL) { + GstBus *bus; + gst_element_set_state (GST_ELEMENT (receiver_entry->pipeline), 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->pipeline)); }