diff options
| author | Po Lu | 2023-09-19 19:57:14 +0800 |
|---|---|---|
| committer | Po Lu | 2023-09-19 19:58:27 +0800 |
| commit | d18be275946eaf4e0297adacb37258cf94e46682 (patch) | |
| tree | 2de67b44393d1e1cf0b09d6af6b56fbc9f6b0f7b /src/android.c | |
| parent | 761f8901fffdb155cbcc7f3b5a2329161c2c1826 (diff) | |
| download | emacs-d18be275946eaf4e0297adacb37258cf94e46682.tar.gz emacs-d18be275946eaf4e0297adacb37258cf94e46682.zip | |
Update Android port
* src/android.c (android_exception_check_1)
(android_exception_check_2, android_exception_check_3)
(android_exception_check_4): Permit each object to be NULL.
(android_browse_url): Release VALUE if an exception transpires.
Diffstat (limited to 'src/android.c')
| -rw-r--r-- | src/android.c | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/src/android.c b/src/android.c index 2cc86d8c56f..bdf99b46eca 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -5710,8 +5710,9 @@ android_exception_check (void) | |||
| 5710 | } | 5710 | } |
| 5711 | 5711 | ||
| 5712 | /* Check for JNI exceptions. If there is one such exception, clear | 5712 | /* Check for JNI exceptions. If there is one such exception, clear |
| 5713 | it, then delete the local reference to OBJECT and call | 5713 | it, then delete the local reference to OBJECT and call memory_full. |
| 5714 | memory_full. */ | 5714 | OBJECT can be NULL, which is a valid local reference to the Java |
| 5715 | null object. */ | ||
| 5715 | 5716 | ||
| 5716 | void | 5717 | void |
| 5717 | android_exception_check_1 (jobject object) | 5718 | android_exception_check_1 (jobject object) |
| @@ -5725,7 +5726,10 @@ android_exception_check_1 (jobject object) | |||
| 5725 | /* Describe exactly what went wrong. */ | 5726 | /* Describe exactly what went wrong. */ |
| 5726 | (*android_java_env)->ExceptionDescribe (android_java_env); | 5727 | (*android_java_env)->ExceptionDescribe (android_java_env); |
| 5727 | (*android_java_env)->ExceptionClear (android_java_env); | 5728 | (*android_java_env)->ExceptionClear (android_java_env); |
| 5728 | ANDROID_DELETE_LOCAL_REF (object); | 5729 | |
| 5730 | if (object) | ||
| 5731 | ANDROID_DELETE_LOCAL_REF (object); | ||
| 5732 | |||
| 5729 | memory_full (0); | 5733 | memory_full (0); |
| 5730 | } | 5734 | } |
| 5731 | 5735 | ||
| @@ -5744,8 +5748,13 @@ android_exception_check_2 (jobject object, jobject object1) | |||
| 5744 | /* Describe exactly what went wrong. */ | 5748 | /* Describe exactly what went wrong. */ |
| 5745 | (*android_java_env)->ExceptionDescribe (android_java_env); | 5749 | (*android_java_env)->ExceptionDescribe (android_java_env); |
| 5746 | (*android_java_env)->ExceptionClear (android_java_env); | 5750 | (*android_java_env)->ExceptionClear (android_java_env); |
| 5747 | ANDROID_DELETE_LOCAL_REF (object); | 5751 | |
| 5748 | ANDROID_DELETE_LOCAL_REF (object1); | 5752 | if (object) |
| 5753 | ANDROID_DELETE_LOCAL_REF (object); | ||
| 5754 | |||
| 5755 | if (object) | ||
| 5756 | ANDROID_DELETE_LOCAL_REF (object1); | ||
| 5757 | |||
| 5749 | memory_full (0); | 5758 | memory_full (0); |
| 5750 | } | 5759 | } |
| 5751 | 5760 | ||
| @@ -5765,9 +5774,16 @@ android_exception_check_3 (jobject object, jobject object1, | |||
| 5765 | /* Describe exactly what went wrong. */ | 5774 | /* Describe exactly what went wrong. */ |
| 5766 | (*android_java_env)->ExceptionDescribe (android_java_env); | 5775 | (*android_java_env)->ExceptionDescribe (android_java_env); |
| 5767 | (*android_java_env)->ExceptionClear (android_java_env); | 5776 | (*android_java_env)->ExceptionClear (android_java_env); |
| 5768 | ANDROID_DELETE_LOCAL_REF (object); | 5777 | |
| 5769 | ANDROID_DELETE_LOCAL_REF (object1); | 5778 | if (object) |
| 5770 | ANDROID_DELETE_LOCAL_REF (object2); | 5779 | ANDROID_DELETE_LOCAL_REF (object); |
| 5780 | |||
| 5781 | if (object) | ||
| 5782 | ANDROID_DELETE_LOCAL_REF (object1); | ||
| 5783 | |||
| 5784 | if (object) | ||
| 5785 | ANDROID_DELETE_LOCAL_REF (object2); | ||
| 5786 | |||
| 5771 | memory_full (0); | 5787 | memory_full (0); |
| 5772 | } | 5788 | } |
| 5773 | 5789 | ||
| @@ -5787,10 +5803,19 @@ android_exception_check_4 (jobject object, jobject object1, | |||
| 5787 | /* Describe exactly what went wrong. */ | 5803 | /* Describe exactly what went wrong. */ |
| 5788 | (*android_java_env)->ExceptionDescribe (android_java_env); | 5804 | (*android_java_env)->ExceptionDescribe (android_java_env); |
| 5789 | (*android_java_env)->ExceptionClear (android_java_env); | 5805 | (*android_java_env)->ExceptionClear (android_java_env); |
| 5790 | ANDROID_DELETE_LOCAL_REF (object); | 5806 | |
| 5791 | ANDROID_DELETE_LOCAL_REF (object1); | 5807 | if (object) |
| 5792 | ANDROID_DELETE_LOCAL_REF (object2); | 5808 | ANDROID_DELETE_LOCAL_REF (object); |
| 5793 | ANDROID_DELETE_LOCAL_REF (object3); | 5809 | |
| 5810 | if (object) | ||
| 5811 | ANDROID_DELETE_LOCAL_REF (object1); | ||
| 5812 | |||
| 5813 | if (object) | ||
| 5814 | ANDROID_DELETE_LOCAL_REF (object2); | ||
| 5815 | |||
| 5816 | if (object) | ||
| 5817 | ANDROID_DELETE_LOCAL_REF (object3); | ||
| 5818 | |||
| 5794 | memory_full (0); | 5819 | memory_full (0); |
| 5795 | } | 5820 | } |
| 5796 | 5821 | ||
| @@ -6127,7 +6152,7 @@ android_browse_url (Lisp_Object url, Lisp_Object send) | |||
| 6127 | buffer = (*android_java_env)->GetStringUTFChars (android_java_env, | 6152 | buffer = (*android_java_env)->GetStringUTFChars (android_java_env, |
| 6128 | (jstring) value, | 6153 | (jstring) value, |
| 6129 | NULL); | 6154 | NULL); |
| 6130 | android_exception_check_1 (string); | 6155 | android_exception_check_1 (value); |
| 6131 | 6156 | ||
| 6132 | /* Otherwise, build the string describing the error. */ | 6157 | /* Otherwise, build the string describing the error. */ |
| 6133 | tem = build_string_from_utf8 (buffer); | 6158 | tem = build_string_from_utf8 (buffer); |