[libcamera-devel] [PATCH 0/3] libcamera: Fix leaks and simplify object management with std::unique_ptr<>

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Dec 12 19:51:13 CET 2020


Hello,

This small patch series is a follow-up of the switch of
V4L2*::fromEntityName() to std::unique_ptr<>. It replaces more manually
managed pointers with std::unique_ptr<> in pipeline handlers, including
expanding usage of V4L2*::fromEntityName(). I've noticed a memory leak
while writing the code, which is fixed in patch 1/3.

Laurent Pinchart (3):
  libcamera: pipeline: raspberrypi: Don't leak RPiCameraData::sensor_
  libcamera: pipeline: vimc: Use V4L2*::fromEntityName() where possible
  libcamera: pipeline: Manage resources with std::unique_ptr<>

 src/libcamera/pipeline/ipu3/cio2.cpp          | 11 ++-----
 src/libcamera/pipeline/ipu3/cio2.h            |  9 +++--
 .../pipeline/raspberrypi/raspberrypi.cpp      |  7 ++--
 src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 19 ++++-------
 src/libcamera/pipeline/simple/converter.cpp   |  8 +----
 src/libcamera/pipeline/simple/converter.h     |  3 +-
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  | 12 +++----
 src/libcamera/pipeline/vimc/vimc.cpp          | 33 +++++++------------
 8 files changed, 34 insertions(+), 68 deletions(-)

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list