Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -130,22 +130,31 @@ } - initWithObject: (OFObject*)obj forKey: (OFObject *)key { - const SEL sel = @selector(setObject:forKey:); - IMP set = [OFMutableDictionary instanceMethodForSelector: sel]; - self = [self init]; @try { - set(self, sel, obj, key); + key = [key copy]; + } @catch (OFException *e) { + [self dealloc]; + @throw e; + } + + @try { + [obj retain]; } @catch (OFException *e) { + [key release]; [self dealloc]; @throw e; } + data[0].key = key; + data[0].object = obj; + data[0].hash = [key hash]; + return self; } /* FIXME: Do it without resizing! */ - initWithObjects: (OFArray*)objs