mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 00:25:07 +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()
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -24,6 +24,8 @@ class CameraProxy;
|
|||
class CameraHalManager : public libcamera::Thread
|
||||
{
|
||||
public:
|
||||
~CameraHalManager();
|
||||
|
||||
int init();
|
||||
|
||||
CameraProxy *open(unsigned int id, const hw_module_t *module);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue