mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-26 12:27:44 +00:00
Introduce formal policy for APIs that return strings.
This declares that any `const char *` returned from SDL is owned by SDL, and promises to be valid _at least_ until the next time the event queue runs, or SDL_Quit() is called, even if the thing that owns the string gets destroyed or changed before then. This is noted in the headers as "the SDL_GetStringRule", so this will both be greppable to find a detailed explaination in docs/README-strings.md and wikiheaders will automatically turn it into a link we can point at the appropriate documentation. Fixes #9902. (and several FIXMEs, both known and yet-undocumented.)
This commit is contained in:
@@ -331,8 +331,7 @@ extern SDL_DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithPropertiesRuntime(SD
|
||||
/**
|
||||
* Get the thread name as it was specified in SDL_CreateThread().
|
||||
*
|
||||
* This is internal memory, not to be freed by the caller, and remains valid
|
||||
* until the specified thread is cleaned up by SDL_WaitThread().
|
||||
* The returned string follows the SDL_GetStringRule.
|
||||
*
|
||||
* \param thread the thread to query
|
||||
* \returns a pointer to a UTF-8 string that names the specified thread, or
|
||||
|
||||
Reference in New Issue
Block a user