Browse Source

Fixed infinite recursion at startup on Android

Sam Lantinga 11 months ago
parent
commit
095fb5f522
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/stdlib/SDL_getenv.c

+ 6 - 1
src/stdlib/SDL_getenv.c

@@ -122,7 +122,12 @@ SDL_Environment *SDL_CreateEnvironment(bool populated)
 #else
 #else
 #ifdef SDL_PLATFORM_ANDROID
 #ifdef SDL_PLATFORM_ANDROID
         // Make sure variables from the application manifest are available
         // Make sure variables from the application manifest are available
-        Android_JNI_GetManifestEnvironmentVariables();
+        static bool initializing;
+        if (!initializing) {
+            initializing = true;
+            Android_JNI_GetManifestEnvironmentVariables();
+            initializing = false;
+        }
 #endif
 #endif
         char **strings = environ;
         char **strings = environ;
         if (strings) {
         if (strings) {