IOS Analysis - Assuming Self is not a Nick

I will analyze my application and run the following error. Can anyone help me?

- (id)initWithLayer:(id)layer
{
    self = [super initWithLayer:layer];

    if (self)
    {
        [self setDefaults];

        MCNewCustomLayer *other = (MCNewCustomLayer*)layer;
        self.value              = other.value;
        self.textLabel          = other.textLabel;
        self.selectionStatus    = other.selectionStatus;
        self.animationDuration  = other.animationDuration;
        self.mainPath           = CGPathCreateMutableCopy(other.mainPath);
        self.fillColor          = CGColorCreateCopy(other.fillColor);
        self.strokeColor        = CGColorCreateCopy(other.strokeColor);
        self.mainPathImage      = other.mainPathImage;
        self.identifier         = other.identifier;
        self.parentLayeredView  = other.parentLayeredView;
        self.isAllowedToAnimate = other.isAllowedToAnimate;
        self.imageBoundsStyle   = other.imageBoundsStyle;

        self.isPresentationLayer  = YES;

    }

    return self;


}

      

The warning message looks like this:

Assuming self is not a nick

The function call "CGPathCreateMutableCopy" returns a Core Foundation object with +1 persistence.

Object leaked: The allocated object is not mentioned later in this execution path and has a persistence value of +1

+3


source to share


1 answer


You want to call CGPathRelease(other.mainPath);

to free the storage counter so that you don't have memory leaks.



0


source







All Articles