]> git.eshelyaron.com Git - emacs.git/commitdiff
Update Android port
authorPo Lu <luangruo@yahoo.com>
Thu, 9 Mar 2023 11:42:13 +0000 (19:42 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 9 Mar 2023 11:42:13 +0000 (19:42 +0800)
* src/android.c (android_destroy_handle): Handle OOM errors in
android_destroy_handle.

src/android.c

index e2ae77e30d053d3a5699bc348901c2bbcdce637f..69c87e731bd7304b2553f851d72df65e01400f26 100644 (file)
@@ -2914,6 +2914,13 @@ android_destroy_handle (android_handle handle)
   (*android_java_env)->CallVoidMethod (android_java_env,
                                       android_handles[handle].handle,
                                       method);
+
+  /* Just clear any exception thrown.  If destroying the handle
+     fails from an out-of-memory error, then Emacs loses some
+     resources, but that is not as big deal as signalling.  */
+  (*android_java_env)->ExceptionClear (android_java_env);
+
+  /* Delete the global reference regardless of any error.  */
   (*android_java_env)->DeleteGlobalRef (android_java_env,
                                        android_handles[handle].handle);
   android_handles[handle].handle = NULL;