Fixed bugs leading to leaks, no autorelease in NSURLComponents factory methods.

This commit is contained in:
alotorev 2020-05-04 02:00:53 +03:00
parent ec62905dd6
commit ce1c03f6da

View file

@ -2225,14 +2225,14 @@ static NSCharacterSet *queryItemCharSet = nil;
// Creating URL components...
+ (instancetype) componentsWithString: (NSString *)urlString
{
return [[NSURLComponents alloc] initWithString: urlString];
return AUTORELEASE([[NSURLComponents alloc] initWithString: urlString]);
}
+ (instancetype) componentsWithURL: (NSURL *)url
resolvingAgainstBaseURL: (BOOL)resolve
{
return [[NSURLComponents alloc] initWithURL: url
resolvingAgainstBaseURL: resolve];
return AUTORELEASE([[NSURLComponents alloc] initWithURL: url
resolvingAgainstBaseURL: resolve]);
}
- (instancetype) init