[libcamera-devel] [PATCH v2] libcamera: pipeline: fix c++20 compile warning

Brett Brotherton bbrotherton at google.com
Tue Nov 28 04:51:18 CET 2023


fix -Wdeprecated-this-capture error when building with c++20 by
explicity naming this in the capture

Signed-off-by: Brett Brotherton <bbrotherton at google.com>
---

updated patch to do explicit capture for C++17 and C++20 compatibility
compiled with both

 src/libcamera/pipeline_handler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 9c74c6cf..29e0c98a 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -649,7 +649,7 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)
  */
 void PipelineHandler::hotplugMediaDevice(MediaDevice *media)
 {
-	media->disconnected.connect(this, [=]() { mediaDeviceDisconnected(media); });
+	media->disconnected.connect(this, [this, media] { mediaDeviceDisconnected(media); });
 }
 
 /**
-- 
2.43.0.rc1.413.gea7ed67945-goog



More information about the libcamera-devel mailing list