From patchwork Thu Nov 12 05:02:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10410 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 579A7BDB89 for ; Thu, 12 Nov 2020 05:03:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D050F63139; Thu, 12 Nov 2020 06:02:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tAMfFbkb"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F48B63139 for ; Thu, 12 Nov 2020 06:02:58 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7CD4431A; Thu, 12 Nov 2020 06:02:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1605157377; bh=qViMzz6/DtwkO0gRPqAGU4m0cGUNIhSHxtBBcofeIeI=; h=From:To:Cc:Subject:Date:From; b=tAMfFbkblPFLgKR9aNt/wh5RQuZPs5lAAuEYhlqIRKE7IsnRZ2vzLXXZNSbhB4ryJ 82SCyZBBVAd76abKHiqDlX6KTN4ia/6PlphtsKNjwAZ34ezbhJD8ZMaHfEQnhoj3v8 6V7p1CJwIzjwmLRu1CiFpvFLSGX3IDrMKAVzdL0c= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 12 Nov 2020 14:02:43 +0900 Message-Id: <20201112050243.32657-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] qcam: Clear the pool of free requests upon stopCapture() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Laurent Pinchart Tested-by: Jean-Michel Hautbois Reviewed-by: Niklas Söderlund Tested-by: Kieran Bingham Reviewed-by: Kieran Bingham --- src/qcam/main_window.cpp | 1 + 1 file changed, 1 insertion(+) 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_;