mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 07:29:09 +00:00
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:
parent
16ff7503b7
commit
90e01040c5
49 changed files with 696 additions and 252 deletions
|
@ -1524,7 +1524,8 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetenv)(
|
|||
const char *utfname = (*env)->GetStringUTFChars(env, name, NULL);
|
||||
const char *utfvalue = (*env)->GetStringUTFChars(env, value, NULL);
|
||||
|
||||
SDL_setenv(utfname, utfvalue, 1);
|
||||
// This is only called at startup, to initialize the environment
|
||||
SDL_setenv_unsafe(utfname, utfvalue, 1);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, name, utfname);
|
||||
(*env)->ReleaseStringUTFChars(env, value, utfvalue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue