mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-09 22:53:55 +01:00
Remove naked malloc (or similar) and free in: other effects
This commit is contained in:
@@ -277,7 +277,8 @@ void AUControl::CreateCocoa()
|
||||
return;
|
||||
}
|
||||
|
||||
AudioUnitCocoaViewInfo *viewInfo = (AudioUnitCocoaViewInfo *) malloc(dataSize);
|
||||
ArrayOf<char> buffer{ dataSize };
|
||||
auto viewInfo = (AudioUnitCocoaViewInfo *) buffer.get();
|
||||
if (viewInfo == NULL)
|
||||
{
|
||||
return;
|
||||
@@ -331,8 +332,6 @@ void AUControl::CreateCocoa()
|
||||
}
|
||||
}
|
||||
|
||||
free(viewInfo);
|
||||
|
||||
if (!mView)
|
||||
{
|
||||
return;
|
||||
@@ -474,7 +473,8 @@ void AUControl::CreateCarbon()
|
||||
return;
|
||||
}
|
||||
|
||||
AudioComponentDescription *compList = (AudioComponentDescription *) malloc(dataSize);
|
||||
ArrayOf<char> buffer{ dataSize };
|
||||
auto compList = (AudioComponentDescription *) buffer.get();
|
||||
if (compList == NULL)
|
||||
{
|
||||
return;
|
||||
@@ -488,11 +488,7 @@ void AUControl::CreateCarbon()
|
||||
compList,
|
||||
&dataSize);
|
||||
if (result != noErr)
|
||||
{
|
||||
free(compList);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the component
|
||||
AudioComponent comp = AudioComponentFindNext(NULL, &compList[0]);
|
||||
@@ -500,9 +496,6 @@ void AUControl::CreateCarbon()
|
||||
// Try to create an instance
|
||||
result = AudioComponentInstanceNew(comp, &mInstance);
|
||||
|
||||
// Done with the list
|
||||
free(compList);
|
||||
|
||||
if (result != noErr)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user