Ubuntu Manpages

#include <SDL3/SDL_surface.h>
void SDL_DestroySurface(SDL_Surface *surface);

It is safe to pass NULL to this function.

the SDL_Surface to free.

No other thread should be using the surface when it is freed.

This function is available since SDL 3.2.0.

SDL_CreateSurface(3), SDL_CreateSurfaceFrom(3)