Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -330,19 +330,22 @@ } #endif - (void)createDirectoryAtIRI: (OFIRI *)IRI { + void *pool = objc_autoreleasePoolPush(); OFIRIHandler *IRIHandler; if (IRI == nil) @throw [OFInvalidArgumentException exception]; if ((IRIHandler = [OFIRIHandler handlerForIRI: IRI]) == nil) @throw [OFUnsupportedProtocolException exceptionWithIRI: IRI]; [IRIHandler createDirectoryAtIRI: IRI]; + + objc_autoreleasePoolPop(pool); } - (void)createDirectoryAtIRI: (OFIRI *)IRI createParents: (bool)createParents { void *pool = objc_autoreleasePoolPush(); @@ -355,10 +358,12 @@ if (IRI == nil) @throw [OFInvalidArgumentException exception]; if (!createParents) { [self createDirectoryAtIRI: IRI]; + + objc_autoreleasePoolPop(pool); return; } /* * Try blindly creating the directory first. @@ -365,15 +370,20 @@ * * The reason for this is that we might be sandboxed, so attempting to * create any of the parent directories will fail, while creating the * directory itself will work. */ - if ([self directoryExistsAtIRI: IRI]) + + if ([self directoryExistsAtIRI: IRI]) { + objc_autoreleasePoolPop(pool); return; + } @try { [self createDirectoryAtIRI: IRI]; + + objc_autoreleasePoolPop(pool); return; } @catch (OFCreateDirectoryFailedException *e) { /* * If we didn't fail because any of the parents is missing, * there is no point in trying to create the parents.