mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Android: Make more meticulous use of DeleteLocalRef
If we're in a function that isn't just going to immediately return to Java, leaking local references can lead to problems eventually.
This commit is contained in:
@ -52,7 +52,9 @@ Java_org_dolphinemu_dolphinemu_model_GameFileCache_getAllGames(JNIEnv* env, jobj
|
||||
env->NewObjectArray(static_cast<jsize>(ptr->GetSize()), IDCache::GetGameFileClass(), nullptr);
|
||||
jsize i = 0;
|
||||
GetPointer(env, obj)->ForEach([env, array, &i](const auto& game_file) {
|
||||
env->SetObjectArrayElement(array, i++, GameFileToJava(env, game_file));
|
||||
jobject j_game_file = GameFileToJava(env, game_file);
|
||||
env->SetObjectArrayElement(array, i++, j_game_file);
|
||||
env->DeleteLocalRef(j_game_file);
|
||||
});
|
||||
return array;
|
||||
}
|
||||
|
Reference in New Issue
Block a user