From 442a0c54eac2894bcae49675980d21615cba03a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 9 Sep 2022 17:06:09 +0200 Subject: [PATCH] spa: libcamera: move shared_ptr to avoid copy --- spa/plugins/libcamera/libcamera-manager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/libcamera/libcamera-manager.cpp b/spa/plugins/libcamera/libcamera-manager.cpp index c8b38b78d..ed48c2cc2 100644 --- a/spa/plugins/libcamera/libcamera-manager.cpp +++ b/spa/plugins/libcamera/libcamera-manager.cpp @@ -29,7 +29,7 @@ #include #include #include - +#include #include #include @@ -127,7 +127,7 @@ static struct device *add_device(struct impl *impl, std::shared_ptr came id = impl->n_devices++; device = &impl->devices[id]; device->id = id; - device->camera = camera; + device->camera = std::move(camera); return device; } @@ -193,7 +193,7 @@ void Impl::addCamera(std::shared_ptr camera) if ((device = find_device(impl, camera.get())) != NULL) return; - if ((device = add_device(impl, camera)) == NULL) + if ((device = add_device(impl, std::move(camera))) == NULL) return; emit_object_info(impl, device);