From f9c0cf2a3a32ff9306da9931218909fa222e8295 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 22 Oct 2020 14:35:12 +0100 Subject: libcamera: MappedBuffer: Disable copy and assignment MappedBuffers have a custom move constructor and assignment operator to ensure that memory is not unmapped during object manipulation. Because of the user-defined move constructor, the implicitly-declared copy-constructor will already be deleted, however delete it explicitly to help readability of the code, and make it clear that the object can not be copied. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- include/libcamera/internal/buffer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/libcamera/internal') diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h index b7b0173f..9da1fbd1 100644 --- a/include/libcamera/internal/buffer.h +++ b/include/libcamera/internal/buffer.h @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -34,6 +35,9 @@ protected: int error_; std::vector maps_; + +private: + LIBCAMERA_DISABLE_COPY(MappedBuffer) }; class MappedFrameBuffer : public MappedBuffer -- cgit v1.2.1