summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2010-05-14 12:05:06 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-05-14 12:05:06 -0700
commit29f5d9b61da0f496fc243edfc838f09a9b5c6eaf (patch)
treef6e4bbf707f7a79ad77cda3f471336a6babe4f78 /libs
parent6c034325a856f4cfb1e8b5bc97adbc7f9dffd0a2 (diff)
parent553447b8ff949618f299bba38ef04c2b6740f1d3 (diff)
downloadframeworks_base-29f5d9b61da0f496fc243edfc838f09a9b5c6eaf.zip
frameworks_base-29f5d9b61da0f496fc243edfc838f09a9b5c6eaf.tar.gz
frameworks_base-29f5d9b61da0f496fc243edfc838f09a9b5c6eaf.tar.bz2
Merge "Fix deadlock if the last reference of ICameraClient is removed in ICamera::connect()" into kraken
Diffstat (limited to 'libs')
-rw-r--r--libs/camera/Camera.cpp7
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()