Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks #55

Open
mabeljarsdel opened this issue Sep 30, 2019 · 2 comments
Open

Memory leaks #55

mabeljarsdel opened this issue Sep 30, 2019 · 2 comments

Comments

@mabeljarsdel
Copy link

mabeljarsdel commented Sep 30, 2019

  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];
}

- (void)resetMatrixToDefault:(NSNumber *)defaultValue {
    if (defaultValue) { // **Converting a pointer value of type 'NSNumber *' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue**
        self.defaultMember = defaultValue;
    }
	self.members = nil;
}

- (NSArray *)allMembers {
    NSMutableArray *allMembers = [NSMutableArray arrayWithCapacity:self.count];
    for (NSUInteger index = 0; index < self.count; index++) {
        [allMembers addObject:self[index]]; // **Argument to 'NSMutableArray' method 'addObject:' cannot be nil**
    }
    
    return allMembers;
}
  1. "UIImage+AGKQuad.h"
- (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'**
}
@mabeljarsdel mabeljarsdel changed the title Memory leacks Memory leaks Sep 30, 2019
@hfossli
Copy link
Contributor

hfossli commented Sep 30, 2019

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

@mabeljarsdel
Copy link
Author

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

No, I don't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants