client: register the global early, in pw_client_new()

otherwise, if the access module blocks the client, the on_start
callback in the protocol is not called and there is no global,
which means the session manager cannot do anything to grant
permissions on this client and the client is blocked forever
This commit is contained in:
George Kiagiadakis 2019-11-19 14:23:10 +02:00 committed by Wim Taymans
parent 5abab5d4da
commit 5f65f1cbbe
2 changed files with 3 additions and 3 deletions

View file

@ -308,9 +308,6 @@ static void on_start(void *data, uint32_t version)
if (version == 0)
client->compat_v2 = &this->compat_v2;
if (pw_client_register(client, NULL) < 0)
return;
return;
}

View file

@ -343,6 +343,9 @@ struct pw_client *pw_client_new(struct pw_core *core,
pw_core_emit_check_access(core, this);
if ((res = pw_client_register(this, NULL)) < 0)
goto error_clear_array;
return this;
error_clear_array: