agent: avoid leak of all turn refreshes when disposing the agent
authorFabrice Bellet <fabrice@bellet.info>
Sat, 19 Dec 2020 16:56:16 +0000 (17:56 +0100)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Tue, 20 Apr 2021 19:37:08 +0000 (19:37 +0000)
commitcaf9f1d8b1d4675c8c88f8f6fa04d3ff5e27f09a
treecdf24c5e44d56f0ba65e9d083faa991b358c9919
parente7b0b78650d5678d38fcede0b4feffca57c067c5
agent: avoid leak of all turn refreshes when disposing the agent

With this patch we free all outstanding refreshes when the agent dispose
method is called, even those that are in the way to be discarded
asynchronously, when a stream is removed.

We also make the final user callback of the refresh proces synchronous,
so we don't have to deal with an heap use-after-free problem. This also
requires to order some parts of code.
agent/agent.c
agent/discovery.c