More leak fixes

This commit is contained in:
rfm 2024-11-16 21:11:56 +00:00
parent d68e8be8ee
commit 5b46efa8cd
14 changed files with 65 additions and 55 deletions

View file

@ -69,15 +69,12 @@ int main()
[dflts setVolatileDomain: domain
forName: @"GSTestDomain"];
# endif
id testObj = [[NSRegularExpression alloc] initWithPattern: @"^a"
options: 0
error: NULL];
id testObj = AUTORELEASE([[NSRegularExpression alloc]
initWithPattern: @"^a" options: 0 error: NULL]);
test_NSObject(@"NSRegularExpression",
[NSArray arrayWithObject:
[[NSRegularExpression alloc] initWithPattern: @"^a"
options: 0
error: NULL]]);
[NSArray arrayWithObject: AUTORELEASE([[NSRegularExpression
alloc] initWithPattern: @"^a" options: 0 error: NULL])]);
test_NSCopying(@"NSRegularExpression",@"NSRegularExpression",
[NSArray arrayWithObject:testObj],NO,NO);
@ -138,10 +135,8 @@ int main()
PASS_EQUAL(replacement, @"c",
"Custom replacement: Returns correct replacement");
NSRegularExpression *testObj2 =
[[NSRegularExpression alloc] initWithPattern: @"bc"
options: 0
error: NULL];
NSRegularExpression *testObj2 = AUTORELEASE([[NSRegularExpression alloc]
initWithPattern: @"bc" options: 0 error: NULL]);
r = [testObj2 firstMatchInString: @"abcdeabcde"
options: 0
range: NSMakeRange(5, 5)];