MIX_DestroyMixer(3)
π MIX_DestroyMixer(3) π
okay bestie, gather round, we're doing a lil cleanup era. this one lives in the SDL_mixer3 functions fam, and it's literally called MIX_DestroyMixer β say hi to the goodbye function. π«Ά
β¨ NAME β¨
MIX_DestroyMixer β free a mixer. yes girl, release it, let it go, it's giving closure. π¦
πΈ SYNOPSIS πΈ
#include <SDL3_mixer/SDL_mixer.h>
void MIX_DestroyMixer(MIX_Mixer *mixer);
π DESCRIPTION π
so here's the tea, bestie. if this mixer was made with MIX_CreateMixerDevice(), then this function will also close the audio device and call SDL_QuitSubSystem(SDL_INIT_AUDIO). like, it does the whole shutdown thing for you, no cap. π
also, any MIX_Group or MIX_Track created for this mixer gets destroyed too. and this is the important part, so listen up: do not touch them again, and do not try to destroy them yourself after the device is destroyed. periodt. π
but MIX_Audio objects? nope, those do not get destroyed, because they can be shared between mixers (they all get destroyed later during MIX_Quit(), so it's fine, they're not being abandoned or anything π). shared girlies stay shared.
π FUNCTION PARAMETERS π
mixerβ the mixer to destroy. that's the one, hand it over. π
π₯ THREAD SAFETY π₯
okay this part matters, so vibe check:
- if you're using this with a
MIX_MixerfromMIX_CreateMixerDevice, then this function should only be called on the main thread. main character energy only, no side quests. π - if you're using this with a
MIX_MixerfromMIX_CreateMixer, then it's safe to call this function from any thread. go wherever you want, queen. π
β AVAILABILITY β
this function has been available since SDL_mixer 3.0.0. it's been iconic since day one, lowkey. π
π SEE ALSO π
and that's the whole page, bestie, mwah π this was brought to you by SDL_mixer, version SDL_mixer 3.2.4 β slay, stan, and read the docs responsibly. ππ¦β¨
π¦ where this page comes from
- fedora 44: SDL3_mixer-doc 3.2.4-3.fc44 Β· Zlib AND (GPL-2.0-or-later OR LGPL-2.0-or-later)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms