pulse-server: add listener after success

Or else we might have freed the hook while it's still added to the
module.
This commit is contained in:
Wim Taymans 2021-03-26 15:13:50 +01:00
parent 69a8c302b1
commit 109411bd2b

View file

@ -89,8 +89,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
if (impl == NULL) if (impl == NULL)
return -errno; return -errno;
pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_log_debug("module %p: new %s", impl, args); pw_log_debug("module %p: new %s", impl, args);
if (args) if (args)
@ -104,6 +102,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
goto error; goto error;
} }
pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;