tools: fix some leaks

This commit is contained in:
Wim Taymans 2020-06-04 12:35:16 +02:00
parent 0ee7d8119c
commit 30571d4706
2 changed files with 32 additions and 1 deletions

View file

@ -540,6 +540,13 @@ static const struct pw_device_events device_events = {
.param = event_param
};
static void
removed_proxy (void *data)
{
struct proxy_data *pd = data;
pw_proxy_destroy(pd->proxy);
}
static void
destroy_proxy (void *data)
{
@ -559,6 +566,7 @@ destroy_proxy (void *data)
static const struct pw_proxy_events proxy_events = {
PW_VERSION_PROXY_EVENTS,
.removed = removed_proxy,
.destroy = destroy_proxy,
};
@ -764,8 +772,10 @@ int main(int argc, char *argv[])
pw_main_loop_run(data.loop);
pw_proxy_destroy((struct pw_proxy*)data.registry);
pw_context_destroy(data.context);
pw_main_loop_destroy(data.loop);
pw_deinit();
return 0;
}