---
name: "SDL_AtomicDecRef"
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_AtomicDecRef"
---

# SDL\_AtomicDecRef(3)

Decrement an atomic variable used as a reference count.

## NAME

SDL\_AtomicDecRef - Decrement an atomic variable used as a reference count.

## HEADER FILE

Defined in SDL3/SDL\_atomic.h

## SYNOPSIS

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

**#define SDL\_AtomicDecRef(a)    (SDL\_AddAtomicInt(a, -1) == 1)**

## DESCRIPTION

**Note: If you don't know what this macro is for, you shouldn't use it!**

## RETURN VALUE

Returns true if the variable reached zero after decrementing, false otherwise.

## THREAD SAFETY

It is safe to call this macro from any thread.

## AVAILABILITY

This macro is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_AtomicIncRef**(3)](/SDL_AtomicIncRef/3.md)
