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:
@@ -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()
|
||||
{
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user