output/osx: use AtScopeExit() to call CFRelease()
This commit is contained in:
parent
0cf85b0771
commit
5c075210d6
@ -20,6 +20,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "OSXOutputPlugin.hxx"
|
#include "OSXOutputPlugin.hxx"
|
||||||
#include "../OutputAPI.hxx"
|
#include "../OutputAPI.hxx"
|
||||||
|
#include "util/ScopeExit.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
#include "thread/Mutex.hxx"
|
#include "thread/Mutex.hxx"
|
||||||
@ -445,6 +446,11 @@ osx_output_set_device(OSXOutput *oo, Error &error)
|
|||||||
char name[256];
|
char name[256];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
AtScopeExit(&cfname) {
|
||||||
|
if (cfname)
|
||||||
|
CFRelease(cfname);
|
||||||
|
};
|
||||||
|
|
||||||
if (oo->component_subtype != kAudioUnitSubType_HALOutput)
|
if (oo->component_subtype != kAudioUnitSubType_HALOutput)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
@ -537,8 +543,6 @@ osx_output_set_device(OSXOutput *oo, Error &error)
|
|||||||
|
|
||||||
done:
|
done:
|
||||||
delete[] deviceids;
|
delete[] deviceids;
|
||||||
if (cfname)
|
|
||||||
CFRelease(cfname);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user