diff --git a/SVGLayer.m b/SVGLayer.m index bf7e0b9c..3af4bbcc 100644 --- a/SVGLayer.m +++ b/SVGLayer.m @@ -50,6 +50,12 @@ - (instancetype)initWithCoder:(NSCoder * const)aDecoder return self; } +- (void)dealloc +{ + CGColorRelease(_fillColor); + CGColorRelease(_strokeColor); +} + - (void)setPaths:(NSArray *)paths { [self willChangeValueForKey:@"paths"]; @@ -86,13 +92,19 @@ - (void)setPaths:(NSArray *)paths - (void)setFillColor:(CGColorRef)aColor { + CGColorRetain(aColor); + CGColorRelease(_fillColor); _fillColor = aColor; + [_shapeLayers setValue:(__bridge id)_fillColor forKey:@"fillColor"]; } - (void)setStrokeColor:(CGColorRef)aColor { + CGColorRetain(aColor); + CGColorRelease(_strokeColor); _strokeColor = aColor; + [_shapeLayers setValue:(__bridge id)_strokeColor forKey:@"strokeColor"]; }