agens-no / AGGeometryKit

Quadrilaterals on CALayer, CGGeometry-functions, UIView/CALayer properties and other invaluable tools.
Other
1.27k stars 130 forks source link

Memory leaks #55

Open mabeljarsdel opened 4 years ago

mabeljarsdel commented 4 years ago
  1. "AGKMatrix.h"

    
    - (NSNumber *)defaultMember {
    if (!_defaultMember) { // **Converting a pointer value of type 'NSNumber *' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue**
        _defaultMember = @0; 
    }
    
    return [_defaultMember copy];
    }
- (UIImage *)imageByCroppingToRect:(CGRect)rect
{
    CGImageRef croppedImage = CGImageCreateWithImageInRect([self CGImage], rect);
    return [UIImage imageWithCGImage:croppedImage scale:self.scale orientation:self.imageOrientation]; // **Potential leak of an object stored into 'croppedImage'**
}
hfossli commented 4 years ago

Good catch! Do you have a pr handy? It may take a day or two before I can fix this

mabeljarsdel commented 4 years ago

Good catch! Do you have a pr handy? It may take a day or two before I can fix this

No, I don't.