examples: copy properties for pw_remote_export()

pw_remote_export() takes ownership of the properties so make a copy
of the ones we still want to hold on to.
This commit is contained in:
Wim Taymans 2019-09-27 10:13:21 +02:00
parent 68fc530d9c
commit c59af4debc
3 changed files with 3 additions and 3 deletions

View file

@ -372,7 +372,7 @@ static struct alsa_object *alsa_create_object(struct monitor *monitor, uint32_t
update_device_props(obj);
obj->proxy = pw_remote_export(impl->remote,
info->type, obj->props, obj->device, 0);
info->type, pw_properties_copy(obj->props), obj->device, 0);
if (obj->proxy == NULL) {
res = -errno;
goto clean_object;

View file

@ -261,7 +261,7 @@ static struct bluez5_object *bluez5_create_object(struct monitor *monitor, uint3
obj->device = iface;
obj->props = pw_properties_new_dict(info->props);
obj->proxy = pw_remote_export(impl->remote,
info->type, obj->props, obj->device, 0);
info->type, pw_properties_copy(obj->props), obj->device, 0);
if (obj->proxy == NULL) {
res = -errno;
goto clean_object;

View file

@ -284,7 +284,7 @@ static struct v4l2_object *v4l2_create_object(struct monitor *monitor, uint32_t
v4l2_update_device_props(obj);
obj->proxy = pw_remote_export(impl->remote,
info->type, obj->props, obj->device, 0);
info->type, pw_properties_copy(obj->props), obj->device, 0);
if (obj->proxy == NULL) {
res = -errno;
goto clean_object;