diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-06-19 14:25:08 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-06-19 14:25:08 -0700 |
commit | b3570568b3f37b3f7018257ece53cbc009b91407 (patch) | |
tree | 15e3dc42fe9e5b15496dd80b2691fc603f8a01cc /services | |
parent | 078a540525f86517aefa4afc56e12fbd74e3823d (diff) | |
parent | 9c8714daaf6a402abd85557e9b652c86f0df86e4 (diff) | |
download | frameworks_av-b3570568b3f37b3f7018257ece53cbc009b91407.zip frameworks_av-b3570568b3f37b3f7018257ece53cbc009b91407.tar.gz frameworks_av-b3570568b3f37b3f7018257ece53cbc009b91407.tar.bz2 |
am 9c8714da: am e6478de7: Camera2/3: Avoid shutdown race in callback processor.
* commit '9c8714daaf6a402abd85557e9b652c86f0df86e4':
Camera2/3: Avoid shutdown race in callback processor.
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/camera2/CallbackProcessor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/camera2/CallbackProcessor.cpp b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp index 78210ab..bc81409 100644 --- a/services/camera/libcameraservice/camera2/CallbackProcessor.cpp +++ b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp @@ -399,6 +399,9 @@ status_t CallbackProcessor::processNewCallback(sp<Camera2Client> &client) { ALOGV("%s: Freeing buffer", __FUNCTION__); mCallbackConsumer->unlockBuffer(imgBuffer); + + // mCallbackHeap may get freed up once input mutex is released + callbackHeap = mCallbackHeap; } // Call outside parameter lock to allow re-entrancy from notification @@ -409,7 +412,7 @@ status_t CallbackProcessor::processNewCallback(sp<Camera2Client> &client) { ALOGV("%s: Camera %d: Invoking client data callback", __FUNCTION__, mId); l.mRemoteCallback->dataCallback(CAMERA_MSG_PREVIEW_FRAME, - mCallbackHeap->mBuffers[heapIdx], NULL); + callbackHeap->mBuffers[heapIdx], NULL); } } |