[libcamera-devel,2/3] Documentation: application-developer: Elaborate on request reuse
diff mbox series

Message ID 20221213093802.704177-3-paul.elder@ideasonboard.com
State New
Headers show
Series
  • lc-compliance: Fix SimpleCapture test
Related show

Commit Message

Paul Elder Dec. 13, 2022, 9:38 a.m. UTC
It recently came to our attention that marking a Request for reuse and
*not* queueing it causes segfaults at Request deallocation time, if it
happens after framebuffer deallocation. Add a note to warn against this
in the application-developer documentation.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 Documentation/guides/application-developer.rst | 4 ++++
 1 file changed, 4 insertions(+)

Patch
diff mbox series

diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst
index 1b2d7727..26d5fc1d 100644
--- a/Documentation/guides/application-developer.rst
+++ b/Documentation/guides/application-developer.rst
@@ -490,6 +490,10 @@  device:
    request->reuse(Request::ReuseBuffers);
    camera->queueRequest(request);
 
+Note that a request should only be marked for re-use if and only if the request
+will be re-queued to the camera device. Marking a request for re-use and not
+queuing it causes undefined behavior.
+
 Request queueing
 ----------------