dchohfi / KeyValueObjectMapping

Automatic KeyValue Object Mapping for Objective-C, parse JSON/plist/Dictionary automatically
http://dchohfi.com/
MIT License
600 stars 90 forks source link

Potential memory leak in DCObjectMapping #78

Open maxoly opened 9 years ago

maxoly commented 9 years ago

Since @property without memory attributed use strong for memory storage, converter property in the class DCObjectMapping should be marked with weak attribute to avoid potential memory leak.

This

@interface DCObjectMapping : NSObject <DCMapping>
..
@property(nonatomic, readonly) id <DCValueConverter> converter;
..
@end

Should be changed in this

@interface DCObjectMapping : NSObject <DCMapping>
..
@property(nonatomic, readonly, weak) id <DCValueConverter> converter;
..
@end
bhargavms commented 8 years ago

I don't get it why should that reference be weak again?