From 81393b9aede340d59e2e403b2ec737c7210ad659 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Wed, 15 Nov 2023 12:19:06 +0800 Subject: [PATCH] Android: Fixed invalid JNIEnv* pointer when starting up love.filesystem for 2nd time. --- src/common/android.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/common/android.cpp b/src/common/android.cpp index a0a1f4444..c10ef99dc 100644 --- a/src/common/android.cpp +++ b/src/common/android.cpp @@ -806,10 +806,9 @@ const char *getCRequirePath() const char *getArg0() { - static PHYSFS_AndroidInit androidInit = { - SDL_AndroidGetJNIEnv(), - SDL_AndroidGetActivity() - }; + static PHYSFS_AndroidInit androidInit = {nullptr, nullptr}; + androidInit.jnienv = SDL_AndroidGetJNIEnv(); + androidInit.context = SDL_AndroidGetActivity(); return (const char *) &androidInit; }