KeyValueObjectMapping icon indicating copy to clipboard operation
KeyValueObjectMapping copied to clipboard

Potential memory leak in DCObjectMapping

Open maxoly opened this issue 10 years ago • 1 comments

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

maxoly avatar Sep 24 '15 14:09 maxoly

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

bhargavms avatar Sep 20 '16 07:09 bhargavms