mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: fix weird property handling
There is no need to copy the properties, just pass ownership. Make sure to always have properties for the server. Ensure we clean up properties on error.
This commit is contained in:
parent
fa39cae9d3
commit
1c3a17362e
2 changed files with 17 additions and 18 deletions
|
|
@ -51,7 +51,6 @@ static const struct spa_dict_item module_props[] = {
|
|||
|
||||
struct impl {
|
||||
struct pw_context *context;
|
||||
struct pw_properties *properties;
|
||||
|
||||
struct spa_hook module_listener;
|
||||
|
||||
|
|
@ -63,8 +62,6 @@ static void impl_free(struct impl *impl)
|
|||
spa_hook_remove(&impl->module_listener);
|
||||
if (impl->pulse)
|
||||
pw_protocol_pulse_destroy(impl->pulse);
|
||||
if (impl->properties)
|
||||
pw_properties_free(impl->properties);
|
||||
free(impl);
|
||||
}
|
||||
|
||||
|
|
@ -101,10 +98,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
|||
else
|
||||
props = NULL;
|
||||
|
||||
impl->properties = props;
|
||||
|
||||
impl->pulse = pw_protocol_pulse_new(context,
|
||||
props ? pw_properties_copy(props) : NULL, 0);
|
||||
impl->pulse = pw_protocol_pulse_new(context, props, 0);
|
||||
if (impl->pulse == NULL) {
|
||||
res = -errno;
|
||||
goto error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue