mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
tools: fix leaks
This commit is contained in:
parent
fa04d2ee1b
commit
49619f2b1e
1 changed files with 14 additions and 11 deletions
|
|
@ -582,23 +582,24 @@ static const struct pw_module_events module_events = {
|
|||
.info = module_event_info
|
||||
};
|
||||
|
||||
static void removed_proxy(void *user_data)
|
||||
{
|
||||
struct global *g = user_data;
|
||||
pw_proxy_destroy(g->proxy);
|
||||
}
|
||||
|
||||
static void destroy_proxy(void *user_data)
|
||||
{
|
||||
struct global *g = user_data;
|
||||
|
||||
if (g->props) {
|
||||
pw_properties_free(g->props);
|
||||
g->props = NULL;
|
||||
}
|
||||
|
||||
if (g->info) {
|
||||
g->info_destroy(g->info);
|
||||
g->info = NULL;
|
||||
}
|
||||
struct global *g = user_data;
|
||||
if (g->props)
|
||||
pw_properties_free(g->props);
|
||||
if (g->info)
|
||||
g->info_destroy(g->info);
|
||||
}
|
||||
|
||||
static const struct pw_proxy_events proxy_events = {
|
||||
PW_VERSION_PROXY_EVENTS,
|
||||
.removed = removed_proxy,
|
||||
.destroy = destroy_proxy,
|
||||
};
|
||||
|
||||
|
|
@ -862,8 +863,10 @@ int main(int argc, char *argv[])
|
|||
draw_graph(&data, dot_path);
|
||||
|
||||
dot_str_clear(&data.dot_str);
|
||||
pw_proxy_destroy((struct pw_proxy*)data.registry);
|
||||
pw_context_destroy(data.context);
|
||||
pw_main_loop_destroy(data.loop);
|
||||
pw_deinit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue