Permalink
Browse files

- Fixed memory leaks in MiscMerge

  • Loading branch information...
1 parent d2b6ff9 commit 4716a9c43e656ea2fc38e3d9096b8e2f273de109 @nikita-zhuk nikita-zhuk committed Jun 4, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 MiscMerge/MiscMergeTemplate.m
  2. +1 −1 MiscMerge/_MiscMergeIncludeCommand.m
@@ -444,9 +444,9 @@ - (void)parseContentsOfFile:(NSString *)filename
"*/
- (void)parseString:(NSString *)string
{
+ NSMutableString *accumString = [[[NSMutableString alloc] init] autorelease];
NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
NSScanner *scanner = [NSScanner scannerWithString:string];
- NSMutableString *accumString = [[NSMutableString alloc] init];
NSString *currString;
int nestingLevel = 0;
int maxNestingLevel = 0;
@@ -53,7 +53,7 @@ - (BOOL)parseFromScanner:(NSScanner *)aScanner template:(MiscMergeTemplate *)tem
resolvedFilename = [template resolveTemplateFilename:filename];
if ([resolvedFilename length] > 0)
- fileString = [[NSString alloc] initWithContentsOfFile:resolvedFilename];
+ fileString = [[[NSString alloc] initWithContentsOfFile:resolvedFilename] autorelease];
if (fileString)
{

0 comments on commit 4716a9c

Please sign in to comment.