API reference / Application
SDL_AppQuit
Function, SDL3
You write this function, and SDL calls it one time at the end of the program. Free your own resources here.
Declaration
#include <SDL3/SDL.h>
void SDL_AppQuit(void *appstate, SDL_AppResult result);Parameters
appstate | The pointer that you stored in SDL_AppInit. |
result | The reason that the program is ending. |
Example
void SDL_AppQuit(void *appstate, SDL_AppResult result)
{
SDL_DestroyTexture(ship);
}See this code run in Load an image. Download the full program (.zip)
Notes
- SDL calls
SDL_Quitfor you after this function returns. SDL also destroys any window and renderer that are still open.
In SDL2
SDL2 has no main callbacks. You put the cleanup at the end of main, and you call SDL_Quit.