diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-10-08 22:25:29 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-08 22:25:29 -0700 |
commit | 5ba6b98cac148e0e5d114ae26127e9189fe6262e (patch) | |
tree | b2ad7958509663b684d1c7fce8a731256ecccc49 /services/camera | |
parent | 245b812096e7af209025b8f50a0519e54f040112 (diff) | |
parent | cbf2b86d223d5b7a9b6a05db2b6d446251586870 (diff) | |
download | frameworks_av-5ba6b98cac148e0e5d114ae26127e9189fe6262e.zip frameworks_av-5ba6b98cac148e0e5d114ae26127e9189fe6262e.tar.gz frameworks_av-5ba6b98cac148e0e5d114ae26127e9189fe6262e.tar.bz2 |
am 843aba43: am 2458d482: Merge "Camera2: Always disconnect in the client destructor" into jb-mr1-dev
* commit '843aba43ef85f5a40db03e0f384ed096b03592d0':
Camera2: Always disconnect in the client destructor
Diffstat (limited to 'services/camera')
-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); |