Skip to content

Commit

Permalink
Fix occasional deadlock in VideoRoom (credits to @mivuDing, fixes #1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Mar 9, 2020
1 parent 9386afb commit dda1508
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,7 @@ void janus_videoroom_destroy_session(janus_plugin_session *handle, int *error) {
}
/* Cleaning up and removing the session is done in a lazy way */
if(!g_atomic_int_get(&session->destroyed)) {
janus_mutex_unlock(&sessions_mutex);
/* Any related WebRTC PeerConnection is not available anymore either */
janus_videoroom_hangup_media_internal(handle);
if(session->participant_type == janus_videoroom_p_type_publisher) {
Expand All @@ -2555,6 +2556,7 @@ void janus_videoroom_destroy_session(janus_plugin_session *handle, int *error) {
}
janus_videoroom_subscriber_destroy(s);
}
janus_mutex_lock(&sessions_mutex);
g_hash_table_remove(sessions, handle);
}
janus_mutex_unlock(&sessions_mutex);
Expand Down

0 comments on commit dda1508

Please sign in to comment.