# Memory Leak: JuceAU::SaveState & Ableton Live 8 (Latest JUCE tip)

**URL:** <https://forum.juce.com/t/memory-leak-juceau-savestate-ableton-live-8-latest-juce-tip/11563>\
**Category:** Audio Plugins\
**Created:** [September 28, 2013, 6:04pm UTC](https://forum.juce.com/t/memory-leak-juceau-savestate-ableton-live-8-latest-juce-tip/11563 "2013-09-28T18:04:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahburnit2](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jahburnit2](https://forum.juce.com/u/jahburnit2)\
**Post date:** [September 28, 2013, 6:04pm UTC](https://forum.juce.com/t/memory-leak-juceau-savestate-ableton-live-8-latest-juce-tip/11563/1 "2013-09-28T18:04:43Z")

</div>

Hey Jules,

I have discovered amemory leak with the latest JUCE tip inside of juce\_AU\_wrapper.mm which only seems to be triggered in Ableton Live 8. Further more, this memory leak was not present in any version of Logic or AU Lab (both 32-bit and 64-bit -- tested w/ Logic Pro 9 and Logic Pro X) and the VST wrapper seemed to handle as expected.

Anyways, I am using Mountain Lion 10.8.5 12F37 with Xcode 4.6.3 (4H1503) and I have setup the build configuration with MacOSX 10.8 as the base SDK and GNU++98 as the dialect.

One more thing to note, is that there are no issues with the VST wrapper in the same version of Ableton Live 8.4.1

From Apple Instruments, here is the call stack as recorded by the leak detector:

&nbsp; &nbsp;0 CoreFoundation \_\_CFAllocatorSystemAllocate  
&nbsp; &nbsp;1 CoreFoundation CFAllocatorAllocate  
&nbsp; &nbsp;2 CoreFoundation \_CFRuntimeCreateInstance  
&nbsp; &nbsp;3 CoreFoundation \_\_CFDataInit  
&nbsp; &nbsp;4 CoreFoundation CFDataCreate  
&nbsp; &nbsp;5 AudioUnitProject JuceAU::SaveState(void const\*\*) /Users/joeburnett/AudioUnitProject/Builds/MacOSX/../../JuceLibraryCode/modules/juce\_audio\_plugin\_client/AU/juce\_AU\_Wrapper.mm:377  
&nbsp; &nbsp;6 AudioUnitProject AUBase::DispatchGetProperty(unsigned long, unsigned long, unsigned long, void\*) /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:556  
&nbsp; &nbsp;7 AudioUnitProject AUBase::ComponentEntryDispatch(ComponentParameters\*, AUBase\*) /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp:219  
&nbsp; &nbsp;8 AudioUnitProject AUMIDIEffectBase::ComponentEntryDispatch(ComponentParameters\*, AUMIDIEffectBase\*) /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp:135  
&nbsp; &nbsp;9 AudioUnitProject ComponentEntryPoint\<JuceAU\>::Dispatch(ComponentParameters\*, JuceAU\*) /Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h:135  
&nbsp; 10 AudioUnitProject AudioUnitProjectAUEntry /Users/joeburnett/AudioUnitProject/Builds/MacOSX/../../JuceLibraryCode/modules/juce\_audio\_plugin\_client/AU/juce\_AU\_Wrapper.mm:1519  
&nbsp; 11 CarbonCore CallComponent  
&nbsp; 12 CarbonCore CallComponentDispatch  
&nbsp; 13 AudioToolbox \_AT\_AudioUnitGetProperty

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 28, 2013, 6:23pm UTC](https://forum.juce.com/t/memory-leak-juceau-savestate-ableton-live-8-latest-juce-tip/11563/2 "2013-09-28T18:23:24Z")

</div>

If&nbsp;you look at the juce code, you can see that it does correctly release that CFData block - it's the host that's doing the leaking&nbsp;there, not the plugin.
