thestk / rtaudio

A set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO, and WASAPI) operating systems.
Other
1.49k stars 317 forks source link

Remove CoreAudio device disconnect listener when closing input mode streams #417

Closed mikedickey closed 7 months ago

mikedickey commented 7 months ago

The flag handle->disconnectListenerAdded[0] is never set to true for input mode streams because the probeOpenStream() code uses handle->disconnectListenerAdded[mode].

This causes RtAudio to never remove device disconnect listeners, which can cause the listener slots to fill up and an "illegal instruction" error code to be returned when you try to add a new one.