Skip to content

Commit

Permalink
Fix leak
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Nov 21, 2024
1 parent 65ae407 commit c224c63
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Tools/AGSParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,7 @@ - (NSMutableDictionary*) parseImplementation
*/
[self skipUnit];
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
return [NSMutableDictionary dictionary];
}
else
Expand Down Expand Up @@ -2526,13 +2526,13 @@ - (NSMutableDictionary*) parseImplementation

DESTROY(unitName);
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
return dict;

fail:
DESTROY(unitName);
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
return nil;
}

Expand Down Expand Up @@ -2692,13 +2692,13 @@ - (NSMutableDictionary*) parseInterface

DESTROY(unitName);
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
return dict;

fail:
DESTROY(unitName);
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
return nil;
}

Expand Down Expand Up @@ -3052,7 +3052,7 @@ - (NSMutableDictionary*) parseMacro

- (NSMutableDictionary*) parseMethodIsDeclaration: (BOOL)flag
{
CREATE_AUTORELEASE_POOL(arp);
IF_NO_ARC(CREATE_AUTORELEASE_POOL(arp);)
NSMutableDictionary *method;
NSMutableString *mname;
NSString *token;
Expand Down Expand Up @@ -3340,14 +3340,14 @@ - (NSMutableDictionary*) parseMethodIsDeclaration: (BOOL)flag
}

DESTROY(itemName);
[arp drain];
IF_NO_ARC([arp release];)
IF_NO_ARC([method autorelease];)
return method;

fail:
DESTROY(itemName);
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
RELEASE(method);
return nil;
}
Expand Down Expand Up @@ -4290,7 +4290,7 @@ - (NSMutableDictionary*) parseProtocol
NSDictionary *methods = nil;
NSMutableDictionary *dict;
NSMutableDictionary *d;
CREATE_AUTORELEASE_POOL(arp);
IF_NO_ARC(CREATE_AUTORELEASE_POOL(arp);)

dict = [[NSMutableDictionary alloc] initWithCapacity: 8];

Expand Down Expand Up @@ -4381,14 +4381,14 @@ - (NSMutableDictionary*) parseProtocol

DESTROY(unitName);
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
IF_NO_ARC([dict autorelease];)
return dict;

fail:
DESTROY(unitName);
DESTROY(comment);
[arp drain];
IF_NO_ARC([arp release];)
RELEASE(dict);
return nil;
}
Expand Down Expand Up @@ -4818,7 +4818,7 @@ - (void) setupBuffer
unichar *inptr;
unichar *outptr;
NSMutableArray *a;
CREATE_AUTORELEASE_POOL(arp);
IF_NO_ARC(CREATE_AUTORELEASE_POOL(arp);)

contents = [NSString stringWithContentsOfFile: fileName];
length = [contents length];
Expand Down Expand Up @@ -4912,7 +4912,7 @@ - (void) setupBuffer
buffer = [data mutableBytes];
pos = 0;
ASSIGN(lines, [NSArray arrayWithArray: a]);
[arp drain];
IF_NO_ARC([arp release];)
IF_NO_ARC([data autorelease];)
}

Expand Down

0 comments on commit c224c63

Please sign in to comment.