diff options
author | James Dong <jdong@google.com> | 2009-04-20 19:35:28 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2009-04-20 19:35:28 -0700 |
commit | e251f32b765afa514648d6a5a2d2da5d0f0a2514 (patch) | |
tree | add7d11e0778675d84c02a135cf10403d695fa95 /camera | |
parent | a0c9e8526b094e3b4f2c2747622059215d00516f (diff) | |
download | frameworks_base-e251f32b765afa514648d6a5a2d2da5d0f0a2514.zip frameworks_base-e251f32b765afa514648d6a5a2d2da5d0f0a2514.tar.gz frameworks_base-e251f32b765afa514648d6a5a2d2da5d0f0a2514.tar.bz2 |
Remove dangling media recorder client reference when setCamera() is used.
Diffstat (limited to 'camera')
-rw-r--r-- | camera/libcameraservice/CameraService.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index cb8ab58..701259e 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -217,7 +217,13 @@ status_t CameraService::Client::unlock() // allow anyone to use camera LOGV("unlock (%p)", getCameraClient()->asBinder().get()); status_t result = checkPid(); - if (result == NO_ERROR) mClientPid = 0; + if (result == NO_ERROR) { + mClientPid = 0; + + // we need to remove the reference so that when app goes + // away, the reference count goes to 0. + mCameraClient.clear(); + } return result; } |