From bbf7f2d7beb24c7d620e62c2030701e6961a29d4 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Sat, 12 Dec 2020 21:12:52 +0100 Subject: agent: warn when closing the agent with alive turn refreshes This patch suggests the developer to close its alive reservations on the turn server before disposing the agent. Not removing reservations on the turn server, will make them alive until their default timeout, generally 300 seconds, which is not fair for the turn server resources, but also it may cause a fatal error 437, "Mismatched allocation: wrong transaction ID", when another agent tries to contact the same turn server using the same nat mapping before this delay expires. --- agent/agent.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agent/agent.c b/agent/agent.c index 40c2146..c15f835 100644 --- a/agent/agent.c +++ b/agent/agent.c @@ -5624,6 +5624,11 @@ nice_agent_dispose (GObject *object) free_queued_signal (sig); } + if (agent->refresh_list) + g_warning ("Agent %p : We still have alive TURN refreshes. Consider " + "using nice_agent_close_async() to prune them before releasing the " + "agent.", agent); + g_free (agent->stun_server_ip); agent->stun_server_ip = NULL; -- cgit v1.2.1