Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/plugins/janus_videoroom.c b/plugins/janus_videoroom.c
- index 7dd182b..86669ac 100644
- --- a/plugins/janus_videoroom.c
- +++ b/plugins/janus_videoroom.c
- @@ -2442,6 +2442,7 @@ void janus_videoroom_destroy_session(janus_plugin_session *handle, int *error) {
- session->participant = NULL;
- if(s->room) {
- janus_refcount_decrease(&s->room->ref);
- + janus_refcount_decrease(&s->ref);
- }
- janus_videoroom_subscriber_destroy(s);
- }
- @@ -4750,7 +4751,7 @@ static void janus_videoroom_hangup_subscriber(janus_videoroom_subscriber * s) {
- /* Already hung up */
- if (!s->feed) {
- return;
- - }
- + }
- /* Check if the owner needs to be cleaned up */
- if(s->pvt_id > 0 && s->room != NULL) {
- janus_mutex_lock(&s->room->mutex);
- @@ -4764,14 +4765,16 @@ static void janus_videoroom_hangup_subscriber(janus_videoroom_subscriber * s) {
- janus_mutex_unlock(&s->room->mutex);
- }
- /* TODO: are we sure this is okay as other handlers use feed directly without synchronization */
- - if(s->feed)
- - g_clear_pointer(&s->feed, janus_videoroom_publisher_dereference_by_subscriber);
- - if(s->room)
- - g_clear_pointer(&s->room, janus_videoroom_room_dereference);
- - if(s->session && s->close_pc)
- - gateway->close_pc(s->session->handle);
- - /* Done with the subscriber and free its reference */
- - janus_refcount_decrease(&s->ref);
- + if(s->feed)
- + g_clear_pointer(&s->feed, janus_videoroom_publisher_dereference_by_subscriber);
- + if(s->close_pc) {
- + if(s->room)
- + g_clear_pointer(&s->room, janus_videoroom_room_dereference);
- + if(s->session)
- + gateway->close_pc(s->session->handle);
- + /* Done with the subscriber and free its reference */
- + janus_refcount_decrease(&s->ref);
- + }
- }
- static void janus_videoroom_hangup_media_internal(janus_plugin_session *handle) {
Add Comment
Please, Sign In to add comment