summaryrefslogtreecommitdiff
path: root/src/cam/camera_session.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-05 07:19:00 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-22 17:13:44 +0300
commit24ca846a27d3b5f3e371dcd039df6ee74dd113c1 (patch)
tree8bd492fe96b28048ce13070547b4d5b2ea0d37db /src/cam/camera_session.h
parent4cd0f586fbc7bc8451bd18aaa3b59fbd8d53574e (diff)
cam: camera_session: Use std::unique_ptr<> to manage class members
Store the BufferWriter and FrameBufferAllocator pointers in std::unique_ptr<> instances to simplify memory management and avoid leaks. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/cam/camera_session.h')
-rw-r--r--src/cam/camera_session.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cam/camera_session.h b/src/cam/camera_session.h
index 5131cfd4..31e8d6db 100644
--- a/src/cam/camera_session.h
+++ b/src/cam/camera_session.h
@@ -44,7 +44,7 @@ private:
libcamera::CameraConfiguration *config_;
std::map<const libcamera::Stream *, std::string> streamName_;
- BufferWriter *writer_;
+ std::unique_ptr<BufferWriter> writer_;
uint64_t last_;
unsigned int queueCount_;
@@ -52,7 +52,7 @@ private:
unsigned int captureLimit_;
bool printMetadata_;
- libcamera::FrameBufferAllocator *allocator_;
+ std::unique_ptr<libcamera::FrameBufferAllocator> allocator_;
std::vector<std::unique_ptr<libcamera::Request>> requests_;
};