[v2,08/42] libcamera: yaml_parser: Use std::make_unique<>
diff mbox series

Message ID 20260407153427.1825999-9-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • libcamera: Global configuration file improvements
Related show

Commit Message

Laurent Pinchart April 7, 2026, 3:33 p.m. UTC
The YamlParser::parse() function constructs a std::unique_ptr<> instance
with a manual call to operator new. Replace it with std::make_unique<>.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/libcamera/yaml_parser.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp
index e13b5faedd81..791fb6eeafa8 100644
--- a/src/libcamera/yaml_parser.cpp
+++ b/src/libcamera/yaml_parser.cpp
@@ -769,7 +769,7 @@  std::unique_ptr<YamlObject> YamlParser::parse(File &file)
 	if (context.init(file))
 		return nullptr;
 
-	std::unique_ptr<YamlObject> root(new YamlObject());
+	std::unique_ptr<YamlObject> root = std::make_unique<YamlObject>();
 
 	if (context.parseContent(*root)) {
 		LOG(YamlParser, Error)