Memory Leak in File::getSpecialLocation?


#1

Hi,

I have the following errors when calling File::createTempFile():

2008-12-21 21:43:54.068 Python[18319] *** _NSAutoreleaseNoPool(): Object 0xad775b0 of class NSCFString autoreleased with no pool in place - just leaking
2008-12-21 21:43:54.068 Python[18319] *** _NSAutoreleaseNoPool(): Object 0xabccbe0 of class NSPathStore2 autoreleased with no pool in place - just leaking
2008-12-21 21:43:54.068 Python[18319] *** _NSAutoreleaseNoPool(): Object 0xad77560 of class NSCFData autoreleased with no pool in place - just leaking

Adding “const ScopedAutoReleasePool pool;” at the beggining of File::getSpecialLocation() (juce_mac_files.mm) seems to fix the problem.

Francis.


#2

Ah yes, thanks. I thought I’d spotted all the places where you’d need an autorelease pool, but I guess that one got away!