1 May 2002 21:08
[ 100838 ] Using NSURL as a key leaks memory
<nobody <at> gnu.org>
2002-05-01 19:08:16 GMT
2002-05-01 19:08:16 GMT
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
RSS Feed