Open
Description
I just ran a customary leak check and found that there is a CFStringRef leaking in assign_device_to_audioqueue
in SDL_coreaudio.m. Version is SDL 2.30.3
I'm not familiar with the core audio api, but it seems like AudioQueueSetProperty
makes a copy of the string, so it's safe to CFBridgingRelease(devuid);
? It fixes the leak, but wanted to ask before submitting a pull request.
Here's the code for quick reference
static int assign_device_to_audioqueue(_THIS)
{
const AudioObjectPropertyAddress prop = {
kAudioDevicePropertyDeviceUID,
this->iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMain
};
OSStatus result;
CFStringRef devuid;
UInt32 devuidsize = sizeof(devuid);
result = AudioObjectGetPropertyData(this->hidden->deviceID, &prop, 0, NULL, &devuidsize, &devuid);
CHECK_RESULT("AudioObjectGetPropertyData (kAudioDevicePropertyDeviceUID)");
result = AudioQueueSetProperty(this->hidden->audioQueue, kAudioQueueProperty_CurrentDevice, &devuid, devuidsize);
CHECK_RESULT("AudioQueueSetProperty (kAudioQueueProperty_CurrentDevice)");
CFBridgingRelease(devuid); // added here
return 1;
}
Metadata
Metadata
Assignees
Labels
No labels