diff options
author | Chih-Chung Chang <chihchung@google.com> | 2010-05-13 15:14:24 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2010-05-14 11:34:20 +0800 |
commit | 553447b8ff949618f299bba38ef04c2b6740f1d3 (patch) | |
tree | 0b9f8777a5f5253525318cbe58514c3103117571 /libs/camera | |
parent | ffd104a903651ca1c64e662df8465c9490da4144 (diff) | |
download | frameworks_base-553447b8ff949618f299bba38ef04c2b6740f1d3.zip frameworks_base-553447b8ff949618f299bba38ef04c2b6740f1d3.tar.gz frameworks_base-553447b8ff949618f299bba38ef04c2b6740f1d3.tar.bz2 |
Fix deadlock if the last reference of ICameraClient is removed in
ICamera::connect()
Change-Id: I34ab3e4f07435c62168175e9bb159022c8fb99f4
Diffstat (limited to 'libs/camera')
-rw-r--r-- | libs/camera/Camera.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/camera/Camera.cpp b/libs/camera/Camera.cpp index 3346b1f..2fbddd5 100644 --- a/libs/camera/Camera.cpp +++ b/libs/camera/Camera.cpp @@ -92,7 +92,12 @@ void Camera::init() Camera::~Camera() { - disconnect(); + // We don't need to call disconnect() here because if the CameraService + // thinks we are the owner of the hardware, it will hold a (strong) + // reference to us, and we can't possibly be here. We also don't want to + // call disconnect() here if we are in the same process as mediaserver, + // because we may be invoked by CameraService::Client::connect() and will + // deadlock if we call any method of ICamera here. } int32_t Camera::getNumberOfCameras() |