src/SDL.c
changeset 9648 e6bf740c92f8
parent 9619 b94b6d0bff0f
child 9649 d7762e30ba24
     1.1 --- a/src/SDL.c	Tue May 26 21:09:48 2015 -0400
     1.2 +++ b/src/SDL.c	Tue May 26 21:13:27 2015 -0400
     1.3 @@ -107,6 +107,7 @@
     1.4  int
     1.5  SDL_InitSubSystem(Uint32 flags)
     1.6  {
     1.7 +    static Uint32 hints_initialized = SDL_FALSE;
     1.8      if (!SDL_MainIsReady) {
     1.9          SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?");
    1.10          return -1;
    1.11 @@ -114,6 +115,13 @@
    1.12  
    1.13      /* Clear the error message */
    1.14      SDL_ClearError();
    1.15 +    
    1.16 +    if (hints_initialized == SDL_FALSE) {
    1.17 +        /* Set a default of -1 for SDL_HINT_THREAD_STACK_SIZE to prevent the
    1.18 +           end user from interfering it's value with environment variables */
    1.19 +        SDL_SetHintWithPriority(SDL_HINT_THREAD_STACK_SIZE, "-1", SDL_HINT_OVERRIDE);
    1.20 +        hints_initialized = SDL_TRUE;
    1.21 +    }
    1.22  
    1.23  #if SDL_VIDEO_DRIVER_WINDOWS
    1.24  	if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {