diff --git a/src/main/android/SDL_android_main.c b/src/main/android/SDL_android_main.c index 08102f8ea..3a53d0929 100644 --- a/src/main/android/SDL_android_main.c +++ b/src/main/android/SDL_android_main.c @@ -47,6 +47,7 @@ int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject arg = SDL_strdup(utf); (*env)->ReleaseStringUTFChars(env, string, utf); } + (*env)->DeleteLocalRef(env, string); } if (!arg) { arg = SDL_strdup("");