From c59af4debc57cbe0bf7bab7dc027055fc62dadad Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 27 Sep 2019 10:13:21 +0200 Subject: [PATCH] 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. --- src/examples/alsa-monitor.c | 2 +- src/examples/bluez-monitor.c | 2 +- src/examples/v4l2-monitor.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/examples/alsa-monitor.c b/src/examples/alsa-monitor.c index e8f499859..0913b93f4 100644 --- a/src/examples/alsa-monitor.c +++ b/src/examples/alsa-monitor.c @@ -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; diff --git a/src/examples/bluez-monitor.c b/src/examples/bluez-monitor.c index 0c273e864..42c26ab4e 100644 --- a/src/examples/bluez-monitor.c +++ b/src/examples/bluez-monitor.c @@ -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; diff --git a/src/examples/v4l2-monitor.c b/src/examples/v4l2-monitor.c index 6f69debc7..3d7e13cfc 100644 --- a/src/examples/v4l2-monitor.c +++ b/src/examples/v4l2-monitor.c @@ -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;