Skip to content

Commit

Permalink
videoroom: Always destroy forwarders on hash map removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode committed Apr 23, 2024
1 parent 0200270 commit 508e84d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/janus_videoroom.c
Expand Up @@ -2817,7 +2817,7 @@ static void janus_videoroom_create_dummy_publisher(janus_videoroom *room, GHashT
janus_mutex_init(&publisher->rtp_forwarders_mutex);
publisher->remote_recipients = g_hash_table_new_full(g_str_hash, g_str_equal,
(GDestroyNotify)g_free, (GDestroyNotify)janus_videoroom_remote_recipient_free);
publisher->rtp_forwarders = g_hash_table_new(NULL, NULL);
publisher->rtp_forwarders = g_hash_table_new_full(NULL, NULL, NULL, (GDestroyNotify)janus_rtp_forwarder_destroy);
publisher->udp_sock = -1;
g_atomic_int_set(&publisher->destroyed, 0);
janus_refcount_init(&publisher->ref, janus_videoroom_publisher_free);
Expand Down Expand Up @@ -7407,7 +7407,7 @@ static json_t *janus_videoroom_process_synchronous_request(janus_videoroom_sessi
janus_mutex_init(&publisher->rtp_forwarders_mutex);
publisher->remote_recipients = g_hash_table_new_full(g_str_hash, g_str_equal,
(GDestroyNotify)g_free, (GDestroyNotify)janus_videoroom_remote_recipient_free);
publisher->rtp_forwarders = g_hash_table_new(NULL, NULL);
publisher->rtp_forwarders = g_hash_table_new_full(NULL, NULL, NULL, (GDestroyNotify)janus_rtp_forwarder_destroy);
publisher->udp_sock = -1;
g_atomic_int_set(&publisher->destroyed, 0);
janus_refcount_init(&publisher->ref, janus_videoroom_publisher_free);
Expand Down Expand Up @@ -9179,7 +9179,7 @@ static void *janus_videoroom_handler(void *data) {
janus_mutex_init(&publisher->rtp_forwarders_mutex);
publisher->remote_recipients = g_hash_table_new_full(g_str_hash, g_str_equal,
(GDestroyNotify)g_free, (GDestroyNotify)janus_videoroom_remote_recipient_free);
publisher->rtp_forwarders = g_hash_table_new(NULL, NULL);
publisher->rtp_forwarders = g_hash_table_new_full(NULL, NULL, NULL, (GDestroyNotify)janus_rtp_forwarder_destroy);
publisher->udp_sock = -1;
/* Finally, generate a private ID: this is only needed in case the participant
* wants to allow the plugin to know which subscriptions belong to them */
Expand Down

0 comments on commit 508e84d

Please sign in to comment.