mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-18 00:40:30 +02:00
Local refs are only freed automatically when a native method returns to Java. The content URI functions mostly run on threads we attached ourselves, where nothing ever freed the strings they created - two per file open, one per exists check and so on. From Android 8 that's a slow leak; before it the table has 512 slots and overflowing it aborts. Add JNILocalFrame (PushLocalFrame/PopLocalFrame) and use it in all of AndroidStorage.cpp, in the camera device list, and free the name string in findClass. Also: Android_GetFileInfo never released its GetStringUTFChars buffer, a native leak on every call, and Android_ListContentUri called GetArrayLength on a null array if the Java side returned none. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>