mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2024-11-10 06:34:22 +00:00
Fix potential minor memory leaks in BGMPreferredOutputDevices.
This commit is contained in:
parent
df9815a4be
commit
a40dfde439
1 changed files with 2 additions and 2 deletions
|
@ -125,7 +125,7 @@ NSString* const kAudioSystemSettingsPlist =
|
|||
BGM_Utils::LogAndSwallowExceptions(BGMDbgArgs, [&] {
|
||||
BGMAudioDevice defaultDevice = CAHALAudioSystemObject().GetDefaultAudioDevice(false, false);
|
||||
NSString* __nullable defaultDeviceUID =
|
||||
(__bridge NSString* __nullable)defaultDevice.CopyDeviceUID();
|
||||
(__bridge_transfer NSString* __nullable)defaultDevice.CopyDeviceUID();
|
||||
|
||||
if (defaultDeviceUID) {
|
||||
preferredOutputDeviceInfos = @[ @{ @"uid": BGMNN(defaultDeviceUID) } ];
|
||||
|
@ -459,7 +459,7 @@ NSString* const kAudioSystemSettingsPlist =
|
|||
BGM_Utils::LogAndSwallowExceptions(BGMDbgArgs, [&] {
|
||||
// Add the new output device to the list.
|
||||
NSString* __nullable outputDeviceUID =
|
||||
(__bridge NSString* __nullable)CAHALAudioDevice(device).CopyDeviceUID();
|
||||
(__bridge_transfer NSString* __nullable)CAHALAudioDevice(device).CopyDeviceUID();
|
||||
|
||||
if (outputDeviceUID) {
|
||||
// Limit the list to three devices because that's what macOS does.
|
||||
|
|
Loading…
Reference in a new issue