From c7bc6bc0644b766339e8bfc89f9e330dcaeea720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 3 Jan 2023 17:12:12 -0500 Subject: [PATCH] webrtc-unidirectional: Avoid critical Don't unref the parameter passed to a signal, it's always owned by the caller. Fixes a GLib critical. Part-of: --- .../webrtc/sendonly/webrtc-unidirectional-h264.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c b/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c index 5d6ed259b7..1fedf8494c 100644 --- a/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c +++ b/subprojects/gst-examples/webrtc/sendonly/webrtc-unidirectional-h264.c @@ -433,7 +433,7 @@ soup_websocket_message_cb (G_GNUC_UNUSED SoupWebsocketConnection * connection, SoupWebsocketDataType data_type, GBytes * message, gpointer user_data) { gsize size; - gchar *data; + const gchar *data; gchar *data_string; const gchar *type_string; JsonNode *root_json; @@ -445,14 +445,12 @@ soup_websocket_message_cb (G_GNUC_UNUSED SoupWebsocketConnection * connection, switch (data_type) { case SOUP_WEBSOCKET_DATA_BINARY: g_error ("Received unknown binary message, ignoring\n"); - g_bytes_unref (message); return; case SOUP_WEBSOCKET_DATA_TEXT: - data = g_bytes_unref_to_data (message, &size); + data = g_bytes_get_data (message, &size); /* Convert to NULL-terminated string */ data_string = g_strndup (data, size); - g_free (data); break; default: