diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-10-08 22:20:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-08 22:20:47 -0700 |
commit | 19caf26b1ab1619020aa417d7913c11fd1d5590d (patch) | |
tree | d5cd51a2f62db49a644f3c62f2d58861593435dd | |
parent | 0ad293aac9af377606fb4aa752b95547a8462791 (diff) | |
parent | be8d28a12e8d08531c6053bcf8ad1183c2f6e6d3 (diff) | |
download | frameworks_av-19caf26b1ab1619020aa417d7913c11fd1d5590d.zip frameworks_av-19caf26b1ab1619020aa417d7913c11fd1d5590d.tar.gz frameworks_av-19caf26b1ab1619020aa417d7913c11fd1d5590d.tar.bz2 |
Merge "Camera2: Always disconnect in the client destructor" into jb-mr1-dev
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 6fbd6ed..124d24d 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -409,6 +409,9 @@ CameraService::Client::Client(const sp<CameraService>& cameraService, // tear down the client CameraService::Client::~Client() { mCameraService->releaseSound(); + + // unconditionally disconnect. function is idempotent + Client::disconnect(); } // ---------------------------------------------------------------------------- @@ -433,6 +436,7 @@ CameraService::Client* CameraService::Client::getClientFromCookie(void* user) { return client; } +// NOTE: function is idempotent void CameraService::Client::disconnect() { mCameraService->removeClient(mCameraClient); mCameraService->setCameraFree(mCameraId); |