Source/DCMessageContextDisplayPlugin.m
changeset 2823 24c471ce6c9e
parent 2822 2a385da3eace
child 2824 0eb39f6eb39c
     1.1 --- a/Source/DCMessageContextDisplayPlugin.m	Wed Nov 25 22:41:51 2009 -0500
     1.2 +++ b/Source/DCMessageContextDisplayPlugin.m	Wed Nov 25 22:55:50 2009 -0500
     1.3 @@ -164,9 +164,6 @@
     1.4  	//Initialize a place to store found messages
     1.5  	NSMutableArray *outerFoundContentContexts = [NSMutableArray arrayWithCapacity:linesLeftToFind]; 
     1.6  
     1.7 -	// These set of file's autorelease pool.
     1.8 -	NSAutoreleasePool *parsingAutoreleasePool = [[NSAutoreleasePool alloc] init];
     1.9 -	
    1.10  	//Iterate over the elements of the log path array.
    1.11  	NSEnumerator *pathsEnumerator = [logPaths objectEnumerator];
    1.12  	NSString *logPath = nil;
    1.13 @@ -237,6 +234,9 @@
    1.14  		off_t offset = [file offsetInFile];
    1.15  		enum LMXParseResult result = LMXParsedIncomplete;
    1.16  
    1.17 +		// These set of file's autorelease pool.
    1.18 +		NSAutoreleasePool *parsingAutoreleasePool = [[NSAutoreleasePool alloc] init];
    1.19 +		
    1.20  		do {
    1.21  			//Calculate the new offset
    1.22  			offset = (offset <= readSize) ? 0 : offset - readSize;
    1.23 @@ -256,7 +256,7 @@
    1.24  		} while ([foundMessages count] < linesLeftToFind && offset > 0 && result != LMXParsedCompletely);
    1.25  
    1.26  		//Drain our autorelease pool.
    1.27 -		[parsingAutoreleasePool drain];
    1.28 +		[parsingAutoreleasePool release];
    1.29  
    1.30  		//Be a good citizen and close the file
    1.31  		[file closeFile];
    1.32 @@ -265,9 +265,7 @@
    1.33  		[outerFoundContentContexts replaceObjectsInRange:NSMakeRange(0, 0) withObjectsFromArray:foundMessages];
    1.34  		linesLeftToFind -= [outerFoundContentContexts count];
    1.35  	}
    1.36 -	
    1.37 -	[parsingAutoreleasePool release];
    1.38 -	
    1.39 +		
    1.40  	if (linesLeftToFind > 0) {
    1.41  		AILogWithSignature(@"Unable to find %d logs for %@", linesLeftToFind, chat);
    1.42  	}
    1.43 @@ -312,7 +310,7 @@
    1.44  			[element setAttributeNames:[attributes allKeys] values:[attributes allValues]];
    1.45  		}
    1.46  		
    1.47 -		NSMutableArray	*foundMessages = [contextInfo objectForKey:@"FoundMessagesValue"];
    1.48 +		NSMutableArray	*foundMessages = [contextInfo objectForKey:@"FoundMessages"];
    1.49  		NSInteger	 *linesLeftToFind = [[contextInfo objectForKey:@"LinesLeftToFindValue"] pointerValue];
    1.50  		
    1.51  		if ([elementName isEqualToString:@"message"]) {