From 022cbeb192b87473fa5d3f18b64a78d5838d4545 Mon Sep 17 00:00:00 2001 From: "mj.Jernigan" Date: Tue, 16 Nov 2021 21:05:59 -0700 Subject: [PATCH] Register missing WebRTCDataChannelJS type (cherry picked from commit a413656e07eaf55a3b164b3fbe22abb9b7aca473) --- modules/webrtc/webrtc_peer_connection_js.cpp | 2 +- modules/webrtc/webrtc_peer_connection_js.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/webrtc/webrtc_peer_connection_js.cpp b/modules/webrtc/webrtc_peer_connection_js.cpp index 3093441175d..814623257ad 100644 --- a/modules/webrtc/webrtc_peer_connection_js.cpp +++ b/modules/webrtc/webrtc_peer_connection_js.cpp @@ -58,7 +58,7 @@ void WebRTCPeerConnectionJS::_on_error(void *p_obj) { void WebRTCPeerConnectionJS::_on_data_channel(void *p_obj, int p_id) { WebRTCPeerConnectionJS *peer = static_cast(p_obj); - peer->emit_signal("data_channel_received", Ref(new WebRTCDataChannelJS(p_id))); + peer->emit_signal("data_channel_received", Ref(memnew(WebRTCDataChannelJS(p_id)))); } void WebRTCPeerConnectionJS::close() { diff --git a/modules/webrtc/webrtc_peer_connection_js.h b/modules/webrtc/webrtc_peer_connection_js.h index 8c1032e1b7b..2e92fbd4fdf 100644 --- a/modules/webrtc/webrtc_peer_connection_js.h +++ b/modules/webrtc/webrtc_peer_connection_js.h @@ -52,6 +52,8 @@ extern int godot_js_rtc_pc_datachannel_create(int p_id, const char *p_label, con } class WebRTCPeerConnectionJS : public WebRTCPeerConnection { + GDCLASS(WebRTCPeerConnectionJS, WebRTCPeerConnection); + private: int _js_id; ConnectionState _conn_state;