android: CameraHalManager: Hold CameraDevice with std::unique_ptr

CameraDevice is owned by CameraHalManager. The ownership of the
object is not shared with other classes. So CameraHalManager
should manage CameraDevice with std::unique_ptr.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Hirokazu Honda 2021-03-24 16:07:50 +09:00 committed by Laurent Pinchart
parent 1d8cc0a3ec
commit 212f410c7c
4 changed files with 8 additions and 11 deletions

View file

@ -350,11 +350,10 @@ CameraDevice::~CameraDevice()
delete it.second;
}
std::shared_ptr<CameraDevice> CameraDevice::create(unsigned int id,
std::unique_ptr<CameraDevice> CameraDevice::create(unsigned int id,
const std::shared_ptr<Camera> &cam)
{
CameraDevice *camera = new CameraDevice(id, cam);
return std::shared_ptr<CameraDevice>(camera);
return std::unique_ptr<CameraDevice>(new CameraDevice(id, cam));
}
/*