android: CameraHalManager: Create a static object dynamically
Originally CameraHalManager is created in the libcamera start up and destroyed in the libcamera termination. However, CameraHalManager destructor can access other static objects that has been destroyed. Avoid this issue by destroying CameraHalManager when tear_down() is called in ChromeOS or leaking it in other platforms. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
a8c9fce109
commit
459b3bc6a9
5 changed files with 22 additions and 9 deletions
|
@ -7,12 +7,15 @@
|
|||
|
||||
#include <cros-camera/cros_camera_hal.h>
|
||||
|
||||
#include "../camera_hal_manager.h"
|
||||
|
||||
static void set_up(cros::CameraMojoChannelManagerToken *token)
|
||||
{
|
||||
}
|
||||
|
||||
static void tear_down()
|
||||
{
|
||||
delete CameraHalManager::instance();
|
||||
}
|
||||
|
||||
cros::cros_camera_hal_t CROS_CAMERA_EXPORT CROS_CAMERA_HAL_INFO_SYM = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue