Automatically clean up memory associated with events

This commit is contained in:
Sam Lantinga
2023-11-05 08:48:37 -08:00
parent 1a83bf2399
commit 70c149c88f
16 changed files with 152 additions and 148 deletions

View File

@@ -69,8 +69,6 @@ int main(int argc, char *argv[])
} else if ((event.type == SDL_EVENT_DROP_FILE) || (event.type == SDL_EVENT_DROP_TEXT)) {
const char *typestr = (event.type == SDL_EVENT_DROP_FILE) ? "File" : "Text";
SDL_Log("%s dropped on window %u: %s at (%f, %f)", typestr, (unsigned int)event.drop.windowID, event.drop.data, event.drop.x, event.drop.y);
/* Normally you'd have to do this, but this is freed in SDLTest_CommonEvent() */
/*SDL_CleanupEvent(&event);*/
} else if (event.type == SDL_EVENT_DROP_POSITION) {
is_hover = SDL_TRUE;
x = event.drop.x;