mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 15:53:54 +03:00
android: camera_hal_manager: Stop thread when destroying
The CameraHalManager starts a thread that is never stopped. This leads to the thread being destroyed while running, which causes a crash. Fix this by stopping the thread and waiting for it to finish in the destructor of the CameraHalManager. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
0ed40d2cd4
commit
06166a331c
2 changed files with 11 additions and 0 deletions
|
@ -28,6 +28,15 @@ LOG_DECLARE_CATEGORY(HAL);
|
|||
* their static information and to open and close camera devices.
|
||||
*/
|
||||
|
||||
CameraHalManager::~CameraHalManager()
|
||||
{
|
||||
if (isRunning()) {
|
||||
exit(0);
|
||||
/* \todo Wait with a timeout, just in case. */
|
||||
wait();
|
||||
}
|
||||
}
|
||||
|
||||
int CameraHalManager::init()
|
||||
{
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue