mirror of https://github.com/libsdl-org/SDL
Allow environment hint overrides before hints are initialized
Fixes https://github.com/libsdl-org/SDL/issues/10514
This commit is contained in:
parent
78b1e0e299
commit
2b853121fe
|
@ -196,13 +196,10 @@ const char *SDL_GetHint(const char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SDL_PropertiesID hints = GetHintProperties(SDL_FALSE);
|
|
||||||
if (!hints) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *retval = SDL_getenv(name);
|
const char *retval = SDL_getenv(name);
|
||||||
|
|
||||||
|
const SDL_PropertiesID hints = GetHintProperties(SDL_FALSE);
|
||||||
|
if (hints) {
|
||||||
SDL_LockProperties(hints);
|
SDL_LockProperties(hints);
|
||||||
|
|
||||||
SDL_Hint *hint = SDL_GetPointerProperty(hints, name, NULL);
|
SDL_Hint *hint = SDL_GetPointerProperty(hints, name, NULL);
|
||||||
|
@ -213,6 +210,7 @@ const char *SDL_GetHint(const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_UnlockProperties(hints);
|
SDL_UnlockProperties(hints);
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue