Added a note to events indicating that memory is owned by SDL

This commit is contained in:
Sam Lantinga
2023-11-05 21:25:43 -08:00
parent 20cd789bab
commit 04dfca958a

View File

@@ -259,6 +259,9 @@ typedef struct SDL_KeyboardEvent
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE 64 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE 64
/** /**
* \brief Keyboard text editing event structure (event.edit.*) * \brief Keyboard text editing event structure (event.edit.*)
*
* The `text` is owned by SDL and should be copied if the application
* wants to hold onto it beyond the scope of handling this event.
*/ */
typedef struct SDL_TextEditingEvent typedef struct SDL_TextEditingEvent
{ {
@@ -273,6 +276,9 @@ typedef struct SDL_TextEditingEvent
#define SDL_TEXTINPUTEVENT_TEXT_SIZE 64 #define SDL_TEXTINPUTEVENT_TEXT_SIZE 64
/** /**
* \brief Keyboard text input event structure (event.text.*) * \brief Keyboard text input event structure (event.text.*)
*
* The `text` is owned by SDL and should be copied if the application
* wants to hold onto it beyond the scope of handling this event.
*/ */
typedef struct SDL_TextInputEvent typedef struct SDL_TextInputEvent
{ {
@@ -508,6 +514,9 @@ typedef struct SDL_TouchFingerEvent
#define SDL_DROPEVENT_DATA_SIZE 64 #define SDL_DROPEVENT_DATA_SIZE 64
/** /**
* \brief An event used to drop text or request a file open by the system (event.drop.*) * \brief An event used to drop text or request a file open by the system (event.drop.*)
*
* The `data` is owned by SDL and should be copied if the application
* wants to hold onto it beyond the scope of handling this event.
*/ */
typedef struct SDL_DropEvent typedef struct SDL_DropEvent
{ {
@@ -580,6 +589,9 @@ typedef struct SDL_SysWMmsg SDL_SysWMmsg;
* \brief A video driver dependent system event (event.syswm.*) * \brief A video driver dependent system event (event.syswm.*)
* This event is disabled by default, you can enable it with SDL_SetEventEnabled() * This event is disabled by default, you can enable it with SDL_SetEventEnabled()
* *
* The `msg` is owned by SDL and should be copied if the application
* wants to hold onto it beyond the scope of handling this event.
*
* \note If you want to use this event, you should include SDL_syswm.h. * \note If you want to use this event, you should include SDL_syswm.h.
*/ */
typedef struct SDL_SysWMEvent typedef struct SDL_SysWMEvent