static void DisconnectFromPulseServer(pa_mainloop *mainloop, pa_context *context) { if (context) { PULSEAUDIO_pa_context_disconnect(context); PULSEAUDIO_pa_context_unref(context); } if (mainloop != NULL) { PULSEAUDIO_pa_mainloop_free(mainloop); } }
static void PULSEAUDIO_CloseDevice(_THIS) { if (this->hidden != NULL) { SDL_FreeAudioMem(this->hidden->mixbuf); this->hidden->mixbuf = NULL; if (this->hidden->stream) { PULSEAUDIO_pa_stream_disconnect(this->hidden->stream); PULSEAUDIO_pa_stream_unref(this->hidden->stream); this->hidden->stream = NULL; } if (this->hidden->context != NULL) { PULSEAUDIO_pa_context_disconnect(this->hidden->context); PULSEAUDIO_pa_context_unref(this->hidden->context); this->hidden->context = NULL; } if (this->hidden->mainloop != NULL) { PULSEAUDIO_pa_mainloop_free(this->hidden->mainloop); this->hidden->mainloop = NULL; } SDL_free(this->hidden); this->hidden = NULL; } }