Show
Ignore:
Timestamp:
02/28/10 16:03:40 (2 years ago)
Author:
gbooker
Message:

Added autorelease pools to reduce temporary memory usage and made sure containing directory exists on a file download.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/SapphireFrappliance/FRAppliance/SapphireURLLoader.m

    r1179 r1197  
    2020 
    2121#import "SapphireURLLoader.h" 
     22#import "NSFileManager-Extensions.h" 
    2223 
    2324#define MAX_WORKERS             10 
     
    8586        while((invoke = [invokeEnum nextObject]) != nil) 
    8687        { 
     88                NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
    8789                [invoke setArgument:&loadedObject atIndex:2]; 
    8890                [invoke invoke]; 
     91                [pool drain]; 
    8992        } 
    9093        [informers release]; 
     
    403406- (void)saveDataAtURL:(NSString *)url toFile:(NSString *)path 
    404407{ 
     408        [[NSFileManager defaultManager] constructPath:[path stringByDeletingLastPathComponent]]; 
    405409        [self loadDataURL:url withTarget:self selector:@selector(saveData:toFile:) object:path]; 
    406410}