---
name: "SDL_AppQuit"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_AppQuit"
---

# SDL\_AppQuit(3)

App-implemented deinit entry point for SDL\_MAIN\_USE\_CALLBACKS apps.

## NAME

SDL\_AppQuit - App-implemented deinit entry point for  **SDL\_MAIN\_USE\_CALLBACKS**\
  apps.

## HEADER FILE

Defined in SDL3/SDL\_main.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**void SDL\_AppQuit(void \*appstate, SDL\_AppResult result);**

## DESCRIPTION

Apps implement this function when using

**SDL\_MAIN\_USE\_CALLBACKS** . If using a standard "main" function, you should not supply this.

This function is called once by SDL before terminating the program.

This function will be called no matter what, even if

**SDL\_AppInit**\
  requests termination.

This function should not go into an infinite mainloop; it should deinitialize any resources necessary, perform whatever shutdown activities, and return.

You do not need to call  **SDL\_Quit** () in this function, as SDL will call it after this function returns and before the process terminates, but it is safe to do so.

The **appstate** parameter is an optional pointer provided by the app during

**SDL\_AppInit** (). If the app never provided a pointer, this will be NULL. This function call is the last time this pointer will be provided, so any resources to it should be cleaned up here.

This function is called by SDL on the main thread.

## FUNCTION PARAMETERS

- *appstate*

  an optional pointer, provided by the app in  **SDL\_AppInit** .

- *result*

  the result code that terminated the app (success or failure).

## THREAD SAFETY

**SDL\_AppEvent** () may get called concurrently with this function if other threads that push events are still active.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_AppInit**(3)](/SDL_AppInit/3.md)
