From 4952d37f4bfaaed43644f56c6798f4c43e70bf68 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Thu, 19 Oct 2023 17:11:42 +0200 Subject: Fix StringName leaks in VariantParser --- modules/webrtc/webrtc_peer_connection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/webrtc/webrtc_peer_connection.cpp') diff --git a/modules/webrtc/webrtc_peer_connection.cpp b/modules/webrtc/webrtc_peer_connection.cpp index 8bad6fd784..0a50b677c4 100644 --- a/modules/webrtc/webrtc_peer_connection.cpp +++ b/modules/webrtc/webrtc_peer_connection.cpp @@ -40,14 +40,14 @@ StringName WebRTCPeerConnection::default_extension; void WebRTCPeerConnection::set_default_extension(const StringName &p_extension) { ERR_FAIL_COND_MSG(!ClassDB::is_parent_class(p_extension, WebRTCPeerConnectionExtension::get_class_static()), vformat("Can't make %s the default WebRTC extension since it does not extend WebRTCPeerConnectionExtension.", p_extension)); - default_extension = p_extension; + default_extension = StringName(p_extension, true); } WebRTCPeerConnection *WebRTCPeerConnection::create() { #ifdef WEB_ENABLED return memnew(WebRTCPeerConnectionJS); #else - if (default_extension == String()) { + if (default_extension == StringName()) { WARN_PRINT_ONCE("No default WebRTC extension configured."); return memnew(WebRTCPeerConnectionExtension); } -- cgit v1.2.3