mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 13:04:41 +00:00
Added SDL_CleanupEvent()
This is used to free any dynamically allocated memory in events.
This commit is contained in:
@@ -181,10 +181,7 @@ static void loop(void)
|
||||
break;
|
||||
case SDL_EVENT_TEXT_EDITING:
|
||||
PrintText("EDIT", event.edit.text);
|
||||
break;
|
||||
case SDL_EVENT_TEXT_EDITING_EXT:
|
||||
PrintText("EDIT_EXT", event.editExt.text);
|
||||
SDL_free(event.editExt.text);
|
||||
SDL_CleanupEvent(&event);
|
||||
break;
|
||||
case SDL_EVENT_TEXT_INPUT:
|
||||
PrintText("INPUT", event.text.text);
|
||||
@@ -261,9 +258,6 @@ int main(int argc, char *argv[])
|
||||
/* Disable mouse emulation */
|
||||
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
|
||||
|
||||
/* Enable extended text editing events */
|
||||
SDL_SetHint(SDL_HINT_IME_SUPPORT_EXTENDED_TEXT, "1");
|
||||
|
||||
/* Initialize SDL */
|
||||
if (!SDLTest_CommonInit(state)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
|
||||
Reference in New Issue
Block a user