diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-12-08 03:40:25 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-12-09 11:26:25 +0200 |
commit | e638ffde530440ec3515f40aa75a414ea1100231 (patch) | |
tree | bb6b060908cd8b150d35ca59e643be4269f9f2e3 /src/libcamera/pipeline/ipu3/cio2.cpp | |
parent | ff2ee0174ca62ab4460adfe20049ed05f52615c5 (diff) |
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/cio2.cpp')
-rw-r--r-- | src/libcamera/pipeline/ipu3/cio2.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index e43ec70f..821715e3 100644 --- a/src/libcamera/pipeline/ipu3/cio2.cpp +++ b/src/libcamera/pipeline/ipu3/cio2.cpp @@ -33,13 +33,12 @@ const std::map<uint32_t, PixelFormat> mbusCodesToPixelFormat = { } /* namespace */ CIO2Device::CIO2Device() - : sensor_(nullptr), csi2_(nullptr), output_(nullptr) + : sensor_(nullptr), csi2_(nullptr) { } CIO2Device::~CIO2Device() { - delete output_; delete csi2_; delete sensor_; } |