From e638ffde530440ec3515f40aa75a414ea1100231 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 8 Dec 2020 03:40:25 +0200 Subject: libcamera: v4l2_device: Return a unique pointer from fromEntityName() The fromEntityName() function returns a pointer to a newly allocated V4L2Device instance, which must be deleted by the caller. This opens the door to memory leaks. Return a unique pointer instead, which conveys the API semantics better than a sentence in the documentation. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/libcamera/pipeline/rkisp1/rkisp1_path.cpp') diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp index e05d9dd6..25f482eb 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp @@ -24,15 +24,10 @@ RkISP1Path::RkISP1Path(const char *name, const Span &formats, const Size &minResolution, const Size &maxResolution) : name_(name), running_(false), formats_(formats), minResolution_(minResolution), maxResolution_(maxResolution), - video_(nullptr), link_(nullptr) + link_(nullptr) { } -RkISP1Path::~RkISP1Path() -{ - delete video_; -} - bool RkISP1Path::init(MediaDevice *media) { std::string resizer = std::string("rkisp1_resizer_") + name_ + "path"; -- cgit v1.2.1