Support Request #100838, was updated on 2002-May-01 15:08
You can respond by visiting: 
http://savannah.gnu.org/support/?func=detailsupport&support_id=100838&group_id=99

Category: Foundation
Status: Open
Priority: 5
Summary: Using NSURL as a key leaks memory

By: lcampbel
Date: 2002-May-01 15:08

Message:
Logged In: NO 
Browser: Mozilla/4.5 (compatible; OmniWeb/4.1-v391; Mac_PowerPC)

The obvious way to implement an NSURLHandle cache is to use the NSURL as a key to an 
NSDictionary. However, this leaks gobs of memory because NSURL doesn't implement hash 
and isEqual:.

To fix, add these two methods to the NSURL implementation:

- (BOOL) isEqual: (NSURL *)other
{
    return [[self absoluteString] isEqualToString:[other absoluteString]];
}

- (unsigned) hash
{
    return [[self absoluteString] hash];
}



----------------------------------------------------------------------
You can respond by visiting: 
http://savannah.gnu.org/support/?func=detailsupport&support_id=100838&group_id=99

_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to