mixDestroyAudio function mixer

void mixDestroyAudio(
  1. Pointer<MixAudio> audio
)

Destroy the specified audio.

MIX_Audio is reference-counted internally, so this function only unrefs it. If doing so causes the reference count to drop to zero, the MIX_Audio will be deallocated. This allows the system to safely operate if the audio is still assigned to a MIX_Track at the time of destruction. The actual destroying will happen when the track stops using it.

But from the caller's perspective, once this function is called, it should assume the audio pointer has become invalid.

Destroying a NULL MIX_Audio is a legal no-op.

\param audio the audio to destroy.

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

\since This function is available since SDL_mixer 3.0.0.

extern SDL_DECLSPEC void SDLCALL MIX_DestroyAudio(MIX_Audio *audio)

Implementation

void mixDestroyAudio(Pointer<MixAudio> audio) {
  final mixDestroyAudioLookupFunction = _libMixer
      .lookupFunction<
        Void Function(Pointer<MixAudio> audio),
        void Function(Pointer<MixAudio> audio)
      >('MIX_DestroyAudio');
  return mixDestroyAudioLookupFunction(audio);
}