webrtcdatachannel: take ref of data so it doesn't disappear
authorMatthew Waters <matthew@centricular.com>
Wed, 26 Sep 2018 06:00:50 +0000 (16:00 +1000)
committerMatthew Waters <matthew@centricular.com>
Wed, 26 Sep 2018 06:01:57 +0000 (16:01 +1000)
ext/webrtc/webrtcdatachannel.c

index 2f46ee4..47263e7 100644 (file)
@@ -808,7 +808,7 @@ gst_webrtc_data_channel_send_data (GstWebRTCDataChannel * channel,
     }
 
     buffer = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, data, size,
-        0, size, bytes, (GDestroyNotify) g_bytes_unref);
+        0, size, g_bytes_ref (bytes), (GDestroyNotify) g_bytes_unref);
     ppid = DATA_CHANNEL_PPID_WEBRTC_BINARY;
   }