From 151480f3e4222855992529eeb23d23375ffe8084 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 13 May 2020 19:24:29 +0300 Subject: [PATCH] object-manager: wait until globals appear before emitting "installed" object managers that are registered a bit early (such as the one in wireplumber-cli) have no use if they are declared as installed before any globals appear. After the initial registry startup, there should be at least 1 global, the core (id=0), so even if this client has no access to any object, the object manager should be able to finish its installation successfully --- lib/wp/object-manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wp/object-manager.c b/lib/wp/object-manager.c index 7ef2de9f..cd6de1b7 100644 --- a/lib/wp/object-manager.c +++ b/lib/wp/object-manager.c @@ -770,11 +770,13 @@ wp_object_manager_maybe_objects_changed (WpObjectManager * self) * - the registry does not have pending globals; these may be interesting * to our object manager, so let's wait a bit until they are released * and re-evaluate again later + * - the registry has globals; if we are on early startup where we don't + * have any globals yet, wait... */ else if (!self->installed) { g_autoptr (WpCore) core = g_weak_ref_get (&self->core); WpRegistry *reg = wp_core_get_registry (core); - if (reg->tmp_globals->len == 0) { + if (reg->tmp_globals->len == 0 && reg->globals->len != 0) { wp_trace_object (self, "installed"); g_signal_emit (self, signals[SIGNAL_INSTALLED], 0); self->installed = TRUE;