Skip to content
Snippets Groups Projects
Commit 151480f3 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

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
parent 27ff8d5e
Branches
Tags
No related merge requests found
......@@ -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;
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment