CALayer内存泄漏

时间:2013-05-16 08:28:56

标签: memory-leaks calayer

我发现我的程序在检测内存时有内存泄漏问题,代码如下

- (CALayer *)layerWithFrame:(CGRect)aFrame
         contentGravity:(NSString *)aContentGravity
           cornerRadius:(float)aRadius
            doubleSided:(BOOL)aValue
{
CALayer *layer = [CALayer layer];
*****layer.frame = aFrame;*****
if (aContentGravity) {
    layer.contentsGravity = aContentGravity;
}
layer.cornerRadius = aRadius;
layer.masksToBounds = YES;
layer.doubleSided = NO;
layer.contentsGravity = kCAGravityBottom;

return layer;
 }

Asterisk是我的程序内存位置,这是使用up代码:

   CALayer *testLayer = [self layerWithFrame: layerRect contentGravity:kCAGravityTop cornerRadius:sublayerCornerRadius doubleSided:NO];

0 个答案:

没有答案