From ae5f8853a40275948f7c53927a2de31e11320094 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 3 Mar 2021 22:58:59 +0100 Subject: [PATCH] Android: Delete more references in IDCache.cpp It's not causing any problems in practice so far, but let's fix it before I add even more stuff without remembering to delete references. --- Source/Android/jni/AndroidCommon/IDCache.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index b5ca604c6e..488fa3782d 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -336,11 +336,13 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) s_linked_hash_map_init = env->GetMethodID(s_linked_hash_map_class, "", "(I)V"); s_linked_hash_map_put = env->GetMethodID( s_linked_hash_map_class, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); + env->DeleteLocalRef(map_class); const jclass compress_cb_class = env->FindClass("org/dolphinemu/dolphinemu/utils/CompressCallback"); s_compress_cb_class = reinterpret_cast(env->NewGlobalRef(compress_cb_class)); s_compress_cb_run = env->GetMethodID(s_compress_cb_class, "run", "(Ljava/lang/String;F)Z"); + env->DeleteLocalRef(compress_cb_class); const jclass content_handler_class = env->FindClass("org/dolphinemu/dolphinemu/utils/ContentHandler"); @@ -358,6 +360,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) s_content_handler_do_file_search = env->GetStaticMethodID(s_content_handler_class, "doFileSearch", "(Ljava/lang/String;[Ljava/lang/String;Z)[Ljava/lang/String;"); + env->DeleteLocalRef(content_handler_class); const jclass network_helper_class = env->FindClass("org/dolphinemu/dolphinemu/utils/NetworkHelper"); @@ -368,11 +371,13 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) env->GetStaticMethodID(s_network_helper_class, "GetNetworkPrefixLength", "()I"); s_network_helper_get_network_gateway = env->GetStaticMethodID(s_network_helper_class, "GetNetworkGateway", "()I"); + env->DeleteLocalRef(network_helper_class); const jclass boolean_supplier_class = env->FindClass("org/dolphinemu/dolphinemu/utils/BooleanSupplier"); s_boolean_supplier_class = reinterpret_cast(env->NewGlobalRef(boolean_supplier_class)); s_boolean_supplier_get = env->GetMethodID(s_boolean_supplier_class, "get", "()Z"); + env->DeleteLocalRef(boolean_supplier_class); return JNI_VERSION; } @@ -393,6 +398,7 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) env->DeleteGlobalRef(s_compress_cb_class); env->DeleteGlobalRef(s_content_handler_class); env->DeleteGlobalRef(s_network_helper_class); + env->DeleteGlobalRef(s_boolean_supplier_class); } #ifdef __cplusplus