diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-11-12 13:58:29 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-11-13 16:11:53 +0900 |
commit | 2d50b1664508e86e4d27b8620e74f8e82dfe1d57 (patch) | |
tree | 5b3bab49bc8d0ae341dd422c6876ea3713ee775c /src/qcam/main_window.cpp | |
parent | abf56416410d6b1e00b1628e3dd9444cd6828797 (diff) |
qcam: Clear the pool of free requests upon stopCapture()
To enable reusing Request objects, we kept a pool of free Requests. This
pool was not cleared upon stopping capture, however, which caused a
segfault when switching to another camera. Fix this by clearing the
Request pool on stopCapture().
Fixes: c753223ad6b9 ("libcamera, android, cam, gstreamer, qcam, v4l2: Reuse Request")
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Diffstat (limited to 'src/qcam/main_window.cpp')
-rw-r--r-- | src/qcam/main_window.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index f140313e..2502ecd4 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -579,6 +579,7 @@ void MainWindow::stopCapture() mappedBuffers_.clear(); requests_.clear(); + freeQueue_.clear(); delete allocator_; |