Revision 793d18b1 plugins/janus_videocall.c

View differences:

plugins/janus_videocall.c
534 534
		*error = -2;
535 535
		return;
536 536
	}
537
	if(session->destroyed) {
538
		JANUS_LOG(LOG_VERB, "VideoCall session already destroyed...\n");
539
		return;
540
	}
541
	JANUS_LOG(LOG_VERB, "Removing VideoCall user %s session...\n", session->username ? session->username : "'unknown'");
542
	janus_videocall_hangup_media(handle);
543
	if(session->username != NULL) {
544
		janus_mutex_lock(&sessions_mutex);
545
		int res = g_hash_table_remove(sessions, (gpointer)session->username);
546
		JANUS_LOG(LOG_VERB, "  -- Removed: %d\n", res);
547
		janus_mutex_unlock(&sessions_mutex);
548
	}
549
	/* Cleaning up and removing the session is done in a lazy way */
550
	session->destroyed = janus_get_monotonic_time();
551 537
	janus_mutex_lock(&sessions_mutex);
552
	old_sessions = g_list_append(old_sessions, session);
538
	if(!session->destroyed) {
539
		session->destroyed = janus_get_monotonic_time();
540
		JANUS_LOG(LOG_VERB, "Removing VideoCall user %s session...\n", session->username ? session->username : "'unknown'");
541
		janus_videocall_hangup_media(handle);
542
		if(session->username != NULL) {
543
			int res = g_hash_table_remove(sessions, (gpointer)session->username);
544
			JANUS_LOG(LOG_VERB, "  -- Removed: %d\n", res);
545
		}
546
		/* Cleaning up and removing the session is done in a lazy way */
547
		old_sessions = g_list_append(old_sessions, session);
548
	}
553 549
	janus_mutex_unlock(&sessions_mutex);
554 550
	return;
555 551
}

Also available in: Unified diff