From f43c57afdb45a6152d43dad01c07a2d2ced92739 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 16 Jun 2021 10:33:32 +0200 Subject: [PATCH] pulse-server: add context listener last Add if after we have done everything else because if there is an error we don't remove it and there will be an invalid hook registered in the context. --- src/modules/module-protocol-pulse/pulse-server.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 38b6d4249..e3db9ee62 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -6665,9 +6665,6 @@ struct pw_protocol_pulse *pw_protocol_pulse_new(struct pw_context *context, spa_list_init(&impl->cleanup_clients); spa_list_init(&impl->free_messages); - pw_context_add_listener(context, &impl->context_listener, - &context_events, impl); - str = pw_properties_get(props, "server.address"); if (str == NULL) { pw_properties_setf(props, "server.address", @@ -6690,6 +6687,8 @@ struct pw_protocol_pulse *pw_protocol_pulse_new(struct pw_context *context, pw_log_warn(NAME" %p: can't create pid file: %s", impl, spa_strerror(res)); } + pw_context_add_listener(context, &impl->context_listener, + &context_events, impl); impl->dbus_name = dbus_request_name(context, "org.pulseaudio.Server");