More leak fixups

This commit is contained in:
rfm 2024-11-17 21:41:43 +00:00
parent 42fa1bf04a
commit 96bbc05b18
6 changed files with 17 additions and 13 deletions

View file

@ -431,6 +431,7 @@ typedef struct
this->_delegate = nil;
[o connection: self didFailWithError: error];
DESTROY(o);
DESTROY(this->_protocol);
}
- (void) URLProtocol: (NSURLProtocol *)protocol
@ -510,6 +511,7 @@ typedef struct
this->_delegate = nil;
[o connectionDidFinishLoading: self];
DESTROY(o);
DESTROY(this->_protocol);
}
- (void) URLProtocol: (NSURLProtocol *)protocol

View file

@ -572,9 +572,9 @@ fprintf(stderr, "Registered retain count %d\n", (int)[registered retainCount]);
[this->output close];
DESTROY(this->input);
DESTROY(this->output);
DESTROY(this->in);
DESTROY(this->out);
}
DESTROY(this->in);
DESTROY(this->out);
DESTROY(this->cachedResponse);
DESTROY(this->request);
#if GS_HAVE_NSURLSESSION
@ -1769,18 +1769,18 @@ fprintf(stderr, "Registered retain count %d\n", (int)[registered retainCount]);
{
NSLog(@"%@ HTTP output stream opened", self);
}
this->in = [[NSString alloc]
initWithFormat: @"(%@:%@ <-- %@:%@)",
s = [NSString stringWithFormat: @"(%@:%@ <-- %@:%@)",
[stream propertyForKey: GSStreamLocalAddressKey],
[stream propertyForKey: GSStreamLocalPortKey],
[stream propertyForKey: GSStreamRemoteAddressKey],
[stream propertyForKey: GSStreamRemotePortKey]];
this->out = [[NSString alloc]
initWithFormat: @"(%@:%@ --> %@:%@)",
ASSIGN(this->in, s);
s = [NSString stringWithFormat: @"(%@:%@ --> %@:%@)",
[stream propertyForKey: GSStreamLocalAddressKey],
[stream propertyForKey: GSStreamLocalPortKey],
[stream propertyForKey: GSStreamRemoteAddressKey],
[stream propertyForKey: GSStreamRemotePortKey]];
ASSIGN(this->out, s);
DESTROY(_writeData);
DESTROY(_masked);
_writeOffset = 0;

View file

@ -685,13 +685,16 @@ newLanguages(NSArray *oldNames)
+ (void) initialize
{
if (self == [NSUserDefaults class])
static BOOL beenHere = NO;
if (NO == beenHere && self == [NSUserDefaults class])
{
ENTER_POOL
NSEnumerator *enumerator;
NSArray *args;
NSString *key;
beenHere = YES;
nextObjectSel = @selector(nextObject);
objectForKeySel = @selector(objectForKey:);
addSel = @selector(addEntriesFromDictionary:);

View file

@ -4,11 +4,11 @@
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSArray *testObj = [NSTimeZone defaultTimeZone];
ENTER_POOL
NSTimeZone *testObj = [NSTimeZone defaultTimeZone];
test_NSObject(@"NSTimeZone", [NSArray arrayWithObject:testObj]);
test_NSObject(@"NSTimeZone", [NSArray arrayWithObject: testObj]);
[arp release]; arp = nil;
LEAVE_POOL
return 0;
}

View file

@ -6,7 +6,6 @@ int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
id current;
id localh;
current = [NSTimeZone defaultTimeZone];
PASS(current != nil && [current isKindOfClass: [NSTimeZone class]],

View file

@ -16,7 +16,7 @@ int main()
httpURL = [NSURL URLWithString: @"http://www.gnustep.org"];
TEST_FOR_CLASS(@"NSURLConnection", [NSURLConnection alloc],
TEST_FOR_CLASS(@"NSURLConnection", AUTORELEASE([NSURLConnection alloc]),
"NSURLConnection +alloc returns an NSURLConnection");
mutable = [NSMutableURLRequest requestWithURL: httpURL];