KeyValueObjectMapping
KeyValueObjectMapping copied to clipboard
Potential memory leak in DCObjectMapping
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
I don't get it why should that reference be weak again?