Don't automatically free temporary memory, let the application call SDL_FreeTemporaryMemory() when it's ready.

Also mark up all functions that return temporary memory with SDL_DECLSPEC_TEMP, to help people implementing language bindings.

Fixes https://github.com/libsdl-org/SDL/issues/10378
This commit is contained in:
Sam Lantinga committed 2024-07-26 10:05:03 -07:00
1 parent 2f38a4bf5e
commit 5e513ecc7f
31 files changed
+124 -402

No files matched your search

+1 -4
View File
@@ -66,9 +66,6 @@ typedef struct SDL_GUID {
/**
* Get an ASCII string representation for a given SDL_GUID.
*
* This returns temporary memory which will be automatically freed later, and
* can be claimed with SDL_ClaimTemporaryMemory().
*
* \param guid the SDL_GUID you wish to convert to string.
* \returns the string representation of the GUID or NULL on failure; call
* SDL_GetError() for more information.
@@ -77,7 +74,7 @@ typedef struct SDL_GUID {
*
* \sa SDL_StringToGUID
*/
extern SDL_DECLSPEC const char * SDLCALL SDL_GUIDToString(SDL_GUID guid);
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GUIDToString(SDL_GUID guid);
/**
* Convert a GUID string into a SDL_GUID structure.