frameworks/base
Révision | cfd78ff5fc7f41b4e4abc04d3690d347644e0bdb (tree) |
---|---|
l'heure | 2009-12-01 15:27:03 |
Auteur | Chih-Chung Chang <chihchung@goog...> |
Commiter | Wu-cheng Li |
Fix 2101425: Camera crashes spontaneously in preview.
The problem is we missed an "obj" parameter while calling
postEventFromNative (which put it in a field of a Message object),
so a garbage value on stack is used.
When the GC tries to follow that "obj" field, expecting to find
another object, it crashes.
Cherry-pick from Eclair.
@@ -112,7 +112,7 @@ void JNICameraContext::notify(int32_t msgType, int32_t ext1, int32_t ext2) | ||
112 | 112 | } |
113 | 113 | JNIEnv *env = AndroidRuntime::getJNIEnv(); |
114 | 114 | env->CallStaticVoidMethod(mCameraJClass, fields.post_event, |
115 | - mCameraJObjectWeak, msgType, ext1, ext2); | |
115 | + mCameraJObjectWeak, msgType, ext1, ext2, NULL); | |
116 | 116 | } |
117 | 117 | |
118 | 118 | void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int msgType) |