mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-02-05 19:30:27 +01:00
wpctl: use auto cleanup for the WpCtl object
This is already done for `WpDaemon` and `WpExec`, so let's do it here as well. This prevents some memory leaks in error paths, which makes it easier to find real issues in the ASan output.
This commit is contained in:
parent
388acb6ff3
commit
6d01627cd0
1 changed files with 3 additions and 2 deletions
|
|
@ -86,6 +86,8 @@ wp_ctl_clear (WpCtl * self)
|
|||
g_clear_pointer (&self->context, g_option_context_free);
|
||||
}
|
||||
|
||||
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (WpCtl, wp_ctl_clear)
|
||||
|
||||
static void
|
||||
async_quit (WpCore *core, GAsyncResult *res, WpCtl * self)
|
||||
{
|
||||
|
|
@ -1347,7 +1349,7 @@ on_plugin_loaded (WpCore * core, GAsyncResult * res, WpCtl *ctl)
|
|||
gint
|
||||
main (gint argc, gchar **argv)
|
||||
{
|
||||
WpCtl ctl = {0};
|
||||
g_auto (WpCtl) ctl = {0};
|
||||
const struct subcommand *cmd = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autofree gchar *summary = NULL;
|
||||
|
|
@ -1447,6 +1449,5 @@ main (gint argc, gchar **argv)
|
|||
|
||||
g_main_loop_run (ctl.loop);
|
||||
|
||||
wp_ctl_clear (&ctl);
|
||||
return ctl.exit_code;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue