diff options
author | Dave Sparks <davidsparks@android.com> | 2009-06-29 19:03:33 -0700 |
---|---|---|
committer | Dave Sparks <davidsparks@android.com> | 2009-06-30 13:20:30 -0700 |
commit | d0cbb1a52d1b2b8b04a122501d696938b295e502 (patch) | |
tree | 1199f1d0f5ee25175a6d3441654e4c9e56a36e33 /core | |
parent | 72d19aa51e90d45c7895629db78e548da2f6d469 (diff) | |
download | frameworks_base-d0cbb1a52d1b2b8b04a122501d696938b295e502.zip frameworks_base-d0cbb1a52d1b2b8b04a122501d696938b295e502.tar.gz frameworks_base-d0cbb1a52d1b2b8b04a122501d696938b295e502.tar.bz2 |
Check to make sure the Java camera object is still valid on the
callback from native. Omitted from previous fix. Bug 1936850.
Diffstat (limited to 'core')
-rw-r--r-- | core/jni/android_hardware_Camera.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp index 3550716..3dcc09f 100644 --- a/core/jni/android_hardware_Camera.cpp +++ b/core/jni/android_hardware_Camera.cpp @@ -171,6 +171,10 @@ void JNICameraContext::postData(int32_t msgType, const sp<IMemory>& dataPtr) // VM pointer will be NULL if object is released Mutex::Autolock _l(mLock); JNIEnv *env = AndroidRuntime::getJNIEnv(); + if (mCameraJObjectWeak == NULL) { + LOGW("callback on dead camera object"); + return; + } // return data based on callback type switch(msgType) { |