Explorar o código

Fixed infinite recursion at startup on Android

Sam Lantinga %!s(int64=2) %!d(string=hai) anos
pai
achega
095fb5f522
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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
 #ifdef SDL_PLATFORM_ANDROID
         // 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
         char **strings = environ;
         if (strings) {