+2005-02-03 Richard Williamson <rjw@apple.com>
+
+ Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
+
+ XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
+ self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
+
+ Reviewed by David Harrison.
+
+ * kwq/KWQLoader.mm:
+ (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
+ (KWQServeRequest):
+ (KWQServeSynchronousRequest):
+
2005-02-03 Chris Blumenberg <cblu@apple.com>
Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
}
@interface NSDictionary (WebCore_Extras)
-- (id)_webcore_initWithHeaderString:(NSString *)string;
++ (id)_webcore_dictionaryWithHeaderString:(NSString *)string;
@end
@implementation NSDictionary (WebCore_Extras)
-- (id)_webcore_initWithHeaderString:(NSString *)string
++ (id)_webcore_dictionaryWithHeaderString:(NSString *)string
{
NSMutableDictionary *headers = [[NSMutableDictionary alloc] init];
}
}
- self = [self initWithDictionary:headers];
+ NSDictionary *dictionary = [NSDictionary dictionaryWithDictionary:headers];
+
[headers release];
- return self;
+
+ return dictionary;
}
@end
QString headerString = job->queryMetaData("customHTTPHeader");
if (!headerString.isEmpty()) {
- headerDict = [[NSDictionary alloc] _webcore_initWithHeaderString:headerString.getNSString()];
+ headerDict = [NSDictionary _webcore_dictionaryWithHeaderString:headerString.getNSString()];
}
if (job->method() == "POST") {
QString headerString = job->queryMetaData("customHTTPHeader");
if (!headerString.isEmpty()) {
- headerDict = [[NSDictionary alloc] _webcore_initWithHeaderString:headerString.getNSString()];
+ headerDict = [[NSDictionary _webcore_dictionaryWithHeaderString:headerString.getNSString()] retain];
}
NSArray *postData = nil;