sdlNetUnrefAddress function

void sdlNetUnrefAddress(
  1. Pointer<SdlNetAddress> address
)

Drop a reference to an SDLNet_Address.

Since several pieces of the library might share a single SDLNet_Address, including a background thread that's working on resolving, these objects are referenced counted. This allows everything that's using it to declare they still want it, and drop their reference to the address when they are done with it. The object's resources are freed when the last reference is dropped.

This function drops a reference to an SDLNet_Address, decreasing its reference count by one.

The documentation will tell you when the app has to explicitly unref an address. For example, SDLNet_ResolveHostname() creates addresses that are already referenced, so the caller needs to unref it when done.

\param address The SDLNet_Address to drop a reference to.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL_Net 3.0.0.

extern SDL_DECLSPEC void SDLCALL SDLNet_UnrefAddress(SDLNet_Address *address)

Implementation

void sdlNetUnrefAddress(Pointer<SdlNetAddress> address) {
  final sdlNetUnrefAddressLookupFunction = libSdl3Net.lookupFunction<
      Void Function(Pointer<SdlNetAddress> address),
      void Function(Pointer<SdlNetAddress> address)>('SDLNet_UnrefAddress');
  return sdlNetUnrefAddressLookupFunction(address);
}