summaryrefslogtreecommitdiffstats
path: root/camera/libcameraservice
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2009-04-20 19:35:28 -0700
committerJames Dong <jdong@google.com>2009-04-20 19:35:28 -0700
commit0ae13e36e1e5052e5f889f1d3e3c07db4f2c03db (patch)
treeeb80a0e16ac7a3a49e4a49cd365bcebd923b14e0 /camera/libcameraservice
parentecb28b3021825c7eb2ff65d7d5528e6acf9fc249 (diff)
downloadframeworks_native-0ae13e36e1e5052e5f889f1d3e3c07db4f2c03db.zip
frameworks_native-0ae13e36e1e5052e5f889f1d3e3c07db4f2c03db.tar.gz
frameworks_native-0ae13e36e1e5052e5f889f1d3e3c07db4f2c03db.tar.bz2
Remove dangling media recorder client reference when setCamera() is used.
Diffstat (limited to 'camera/libcameraservice')
-rw-r--r--camera/libcameraservice/CameraService.cpp8
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;
}