summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-11 19:34:44 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-16 23:57:27 +0300
commite77c8951e9ff91bf2bacf81791a882ccb3cee30b (patch)
treeac66ba86468ae1aa5ad619c5fb276687aee65677 /src/android
parent5420e359f2416f6d290eea626dddb3a881dd900c (diff)
libcamera: base: extensible: Pass private pointer as unique_ptr<>
The Extensible constructor takes a pointer to a Private instance, whose lifetime it then manages. Make this explicit in the API by passing the pointer as a std::unique_ptr<Private>. 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/android')
-rw-r--r--src/android/camera_buffer.h2
-rw-r--r--src/android/camera_hal_config.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h
index 21373fa2..c4e3a9e7 100644
--- a/src/android/camera_buffer.h
+++ b/src/android/camera_buffer.h
@@ -32,7 +32,7 @@ public:
#define PUBLIC_CAMERA_BUFFER_IMPLEMENTATION \
CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags) \
- : Extensible(new Private(this, camera3Buffer, flags)) \
+ : Extensible(std::make_unique<Private>(this, camera3Buffer, flags)) \
{ \
} \
CameraBuffer::~CameraBuffer() \
diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp
index 14549083..aa90dac7 100644
--- a/src/android/camera_hal_config.cpp
+++ b/src/android/camera_hal_config.cpp
@@ -341,7 +341,7 @@ int CameraHalConfig::Private::parseConfigFile(FILE *fh,
}
CameraHalConfig::CameraHalConfig()
- : Extensible(new Private()), exists_(false), valid_(false)
+ : Extensible(std::make_unique<Private>()), exists_(false), valid_(false)
{
parseConfigurationFile();
}