NET_FreeLocalAddresses(3)

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

πŸ’– NET_FreeLocalAddresses(3) πŸ’–

okay bestie, welcome to the SDL_net3 section of the manual β€” yes that's the manual name, we're in the SDL_net3 FUNCTIONS zone, stay with me 🫢


✨ NAME ✨

NET_FreeLocalAddresses β€” the lil cleanup crew that frees the results you got from NET_GetLocalAddresses.


🌸 SYNOPSIS 🌸

#include <SDL3_net/SDL_net.h>

void NET_FreeLocalAddresses(NET_Address **addresses);

πŸŽ€ DESCRIPTION πŸŽ€

so basically, this function unrefs every address in the array and then frees the array itself. two-for-one. ate. πŸ’…

here's the cute part: addresses are reference counted, so it is totally safe to keep any addresses you want from this array even after you call this function β€” as long as you called NET_RefAddress() on them first. like, grab your faves, ref them, then let the array go. no cap. ✨

and it is safe to pass a NULL in here β€” it will just be ignored. no drama, no crash, iconic behaviour honestly. πŸ¦‹


🧚 FUNCTION PARAMETERS 🧚

  • addresses β€” a pointer that was returned by NET_GetLocalAddresses(). yes, that exact one. don't be out here making up your own. πŸ™ˆ

πŸ”₯ THREAD SAFETY πŸ”₯

it is safe to call this function from any thread. literally any of them. go wild. πŸ‘‘


πŸ’œ AVAILABILITY πŸ’œ

this function has been available since SDL_net 3.0.0. vintage but make it fresh. 🌈


not me ending the page without a single warning section because there isn't one 😭 the whole thing is just safe. we love a low-stress free function fr fr. πŸ’–

kisses, this has been your girl from the SDL_net era β€” the docs are stamped SDL_net 3.2.0, so if your version is giving something older, that's a whole different vibe check. bye bestie, go free those addresses responsibly πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from