mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
More leak fixes
This commit is contained in:
parent
d68e8be8ee
commit
5b46efa8cd
14 changed files with 65 additions and 55 deletions
|
@ -131,6 +131,7 @@ NSRegularExpressionOptionsToURegexpFlags(NSRegularExpressionOptions opts)
|
|||
exp = [NSException exceptionWithName: NSInvalidArgumentException
|
||||
reason: @"nil argument"
|
||||
userInfo: nil];
|
||||
RELEASE(self);
|
||||
[exp raise];
|
||||
}
|
||||
|
||||
|
@ -961,10 +962,9 @@ prepareResult(NSRegularExpression *regex,
|
|||
return nil;
|
||||
}
|
||||
utext_clone(&ret->txt, output, TRUE, TRUE, &s);
|
||||
uregex_close(r);
|
||||
|
||||
utext_close(&txt);
|
||||
utext_close(output);
|
||||
uregex_close(r);
|
||||
utext_close(&txt);
|
||||
utext_close(&replacement);
|
||||
return AUTORELEASE(ret);
|
||||
}
|
||||
|
|
|
@ -658,14 +658,17 @@ static NSUInteger urlAlign;
|
|||
isDirectory: (BOOL)isDir
|
||||
relativeToURL: (NSURL *)baseURL
|
||||
{
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
BOOL flag = NO;
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
BOOL flag = NO;
|
||||
|
||||
if (nil == aPath)
|
||||
{
|
||||
NSString *name = NSStringFromClass([self class]);
|
||||
|
||||
RELEASE(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ %@] nil string parameter",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
name, NSStringFromSelector(_cmd)];
|
||||
}
|
||||
if ([aPath isAbsolutePath] == NO)
|
||||
{
|
||||
|
@ -803,16 +806,22 @@ static NSUInteger urlAlign;
|
|||
}
|
||||
if ([aUrlString isKindOfClass: [NSString class]] == NO)
|
||||
{
|
||||
NSString *name = NSStringFromClass([self class]);
|
||||
|
||||
RELEASE(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ %@] bad string parameter",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
name, NSStringFromSelector(_cmd)];
|
||||
}
|
||||
if (aBaseUrl != nil
|
||||
&& [aBaseUrl isKindOfClass: [NSURL class]] == NO)
|
||||
{
|
||||
NSString *name = NSStringFromClass([self class]);
|
||||
RELEASE(self);
|
||||
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[%@ %@] bad base URL parameter",
|
||||
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
|
||||
name, NSStringFromSelector(_cmd)];
|
||||
}
|
||||
ASSIGNCOPY(_urlString, aUrlString);
|
||||
ASSIGN(_baseURL, [aBaseUrl absoluteURL]);
|
||||
|
@ -2301,14 +2310,14 @@ static NSCharacterSet *queryItemCharSet = nil;
|
|||
// Creating URL components...
|
||||
+ (instancetype) componentsWithString: (NSString *)urlString
|
||||
{
|
||||
return AUTORELEASE([[NSURLComponents alloc] initWithString: urlString]);
|
||||
return AUTORELEASE([[NSURLComponents alloc] initWithString: urlString]);
|
||||
}
|
||||
|
||||
+ (instancetype) componentsWithURL: (NSURL *)url
|
||||
resolvingAgainstBaseURL: (BOOL)resolve
|
||||
{
|
||||
return AUTORELEASE([[NSURLComponents alloc] initWithURL: url
|
||||
resolvingAgainstBaseURL: resolve]);
|
||||
return AUTORELEASE([[NSURLComponents alloc] initWithURL: url
|
||||
resolvingAgainstBaseURL: resolve]);
|
||||
}
|
||||
|
||||
- (instancetype) init
|
||||
|
@ -2342,6 +2351,7 @@ static NSCharacterSet *queryItemCharSet = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue