mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for AU string leak.
This commit is contained in:
parent
2cf131f0a6
commit
35b9b9a317
1 changed files with 14 additions and 4 deletions
|
|
@ -163,6 +163,7 @@ public:
|
|||
{
|
||||
deleteActiveEditors();
|
||||
juceFilter = nullptr;
|
||||
clearPresetsArray();
|
||||
|
||||
jassert (activePlugins.contains (this));
|
||||
activePlugins.removeFirstMatchingValue (this);
|
||||
|
|
@ -870,7 +871,9 @@ protected:
|
|||
if (outData != nullptr)
|
||||
{
|
||||
const int numPrograms = juceFilter->getNumPrograms();
|
||||
presetsArray.calloc (numPrograms);
|
||||
|
||||
clearPresetsArray();
|
||||
presetsArray.insertMultiple (0, AUPreset(), numPrograms);
|
||||
|
||||
CFMutableArrayRef presetsArrayRef = CFArrayCreateMutable (0, numPrograms, 0);
|
||||
|
||||
|
|
@ -880,12 +883,11 @@ protected:
|
|||
if (name.isEmpty())
|
||||
name = "Untitled";
|
||||
|
||||
AUPreset& p = presetsArray[i];
|
||||
AUPreset& p = presetsArray.getReference(i);
|
||||
p.presetNumber = i;
|
||||
p.presetName = name.toCFString();
|
||||
|
||||
CFArrayAppendValue (presetsArrayRef, &p);
|
||||
CFRelease (p.presetName);
|
||||
}
|
||||
|
||||
*outData = (CFArrayRef) presetsArrayRef;
|
||||
|
|
@ -934,9 +936,17 @@ private:
|
|||
SMPTETime lastSMPTETime;
|
||||
AUChannelInfo channelInfo [numChannelConfigs];
|
||||
AudioUnitEvent auEvent;
|
||||
mutable HeapBlock<AUPreset> presetsArray;
|
||||
mutable Array<AUPreset> presetsArray;
|
||||
CriticalSection incomingMidiLock;
|
||||
|
||||
void clearPresetsArray() const
|
||||
{
|
||||
for (int i = presetsArray.size(); --i >= 0;)
|
||||
CFRelease (presetsArray.getReference(i).presetName);
|
||||
|
||||
presetsArray.clear();
|
||||
}
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (JuceAU);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue