From: Po Lu Date: Sun, 12 May 2024 12:24:19 +0000 (+0800) Subject: Properly deinitialize directory cursors on closedir X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~1531 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=86d196c71d763ae81229e7e1eb2c6e37d0456f06;p=emacs.git Properly deinitialize directory cursors on closedir * src/androidvfs.c (android_saf_tree_closedir): Call cursor.close, for deleting the local reference to enable its garbage collection is not sufficient to release all related resources. --- diff --git a/src/androidvfs.c b/src/androidvfs.c index 004abd62518..c0bd86e54b8 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -5562,6 +5562,10 @@ android_saf_tree_closedir (struct android_vdir *vdir) free (dir->name); /* Yes, DIR->cursor is a local reference. */ + (*android_java_env)->CallVoidMethod (android_java_env, + dir->cursor, + cursor_class.close); + (*android_java_env)->ExceptionClear (android_java_env); ANDROID_DELETE_LOCAL_REF (dir->cursor); /* If the ``directory file descriptor'' has been opened, close