From 6e67000d5e42fc30e6f7ff3ec5544e0be8dcbf00 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Sat, 16 Oct 2021 09:51:00 +0300 Subject: [PATCH] si-standard-link: fix crash after returning a link error If one link fails, the activation transition will return, but then other links will continue to call the callback and try to access the now invalid activation transition. With this change, the callback is bound to the lifetime of the transition and will stop being called after the transition returns Fixes #76 --- modules/module-si-standard-link.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/module-si-standard-link.c b/modules/module-si-standard-link.c index 5dda0581..95ec7ca5 100644 --- a/modules/module-si-standard-link.c +++ b/modules/module-si-standard-link.c @@ -310,9 +310,10 @@ create_links (WpSiStandardLink * self, WpTransition * transition, /* activate to ensure it is created without errors */ self->n_async_ops_wait++; - wp_object_activate (WP_OBJECT (link), + wp_object_activate_closure (WP_OBJECT (link), WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL, NULL, - (GAsyncReadyCallback) on_link_activated, transition); + g_cclosure_new_object ( + (GCallback) on_link_activated, G_OBJECT (transition))); } g_variant_iter_free (iter); return self->node_links->len > 0; -- GitLab