MIX_DestroyMixer(3)

πŸ“¦
version 3.2.4 Β· 2 versions
, in fedora 44

πŸ’– 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_Mixer from MIX_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_Mixer from MIX_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