Added thread-safe environment functions
Also marked the existing functions as unsafe, as they can cause crashes if used in multi-threaded applications. As a bonus, since the new functions are hashtable based, hint environment lookups are much faster.
This commit is contained in:
@@ -130,7 +130,7 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
SDL_free(value);
|
||||
|
||||
/* Set default value in environment */
|
||||
SDL_setenv(testHint, "original", 1);
|
||||
SDL_SetEnvironmentVariable(SDL_GetEnvironment(), testHint, "original", 1);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_GetHint() after saving and restoring hint");
|
||||
originalValue = SDL_GetHint(testHint);
|
||||
|
||||
Reference in New Issue
Block a user