- 204 if (inputEventObj) {
- 208 env->CallVoidMethod(mReceiverObjGlobal,
- 209 gInputEventReceiverClassInfo.dispatchInputEvent, seq, inputEventObj);
- 210 if (env->ExceptionCheck()) {
- 211 ALOGE("Exception dispatching input event.");
- 212 skipCallbacks = true;
- 213 }
- 214 env->DeleteLocalRef(inputEventObj);
- 215 } else {
- 216 ALOGW("channel '%s' ~ Failed to obtain event object.", getInputChannelName());
- 217 skipCallbacks = true;
- 218 }
The 4.1.2 source hasn't Line 214 . Lack of line 214 lead to java object inputEventObj leak. Android system print error like:- dalvikvm: JNI ERROR (app bug): local reference table overflow (max=512)
- 09-25 11:56:11.939 712 729 W dalvikvm: JNI local reference table (0x5c3a3500) dump:
- 09-25 11:56:11.939 712 729 W dalvikvm: Last 10 entries (of 512):
- 09-25 11:56:11.939 712 729 W dalvikvm: 511: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 510: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 509: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 508: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 507: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 506: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 505: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 504: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 503: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: 502: 0x42677b00 android.view.MotionEvent
- 09-25 11:56:11.939 712 729 W dalvikvm: Summary:
- 09-25 11:56:11.939 712 729 W dalvikvm: 1 of java.lang.Class
- 09-25 11:56:11.939 712 729 W dalvikvm: 511 of android.view.MotionEvent (1 unique instances)
- 09-25 11:56:11.939 712 729 E dalvikvm: Failed adding to JNI local ref table (has 512 entries)
09-18 21:58