[libcamera-devel] [PATCH 2/2] libcamera: v4l2_videodevice: Clear cache_ in ~V4L2BufferCache()

Umang Jain umang.jain at ideasonboard.com
Fri Jul 9 13:47:36 CEST 2021


This shall help release any taken reference, just in case.

Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
 src/libcamera/v4l2_videodevice.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index da2af6a1..1e33571c 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -190,6 +190,8 @@ V4L2BufferCache::~V4L2BufferCache()
 {
 	if (missCounter_ > cache_.size())
 		LOG(V4L2, Debug) << "Cache misses: " << missCounter_;
+
+	cache_.clear();
 }
 
 /**
-- 
2.31.1



More information about the libcamera-devel mailing list