Browse files

Fixed static analyzer issues (leaks).

Closes #15.
  • Loading branch information...
1 parent 0a516ff commit 3e3e361d5526f4cfcc3e814f3aa4237d3267b6e0 @matej matej committed Jun 27, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −2 Demo/Classes/HudDemoViewController.m
  2. +1 −0 Demo/HudDemo.xcodeproj/project.pbxproj
  3. +2 −0 MBProgressHUD.m
View
3 Demo/Classes/HudDemoViewController.m
@@ -157,6 +157,7 @@ - (IBAction)showURL:(id)sender {
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];
+ [connection release];
HUD = [[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES] retain];
}
@@ -237,12 +238,10 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
HUD.mode = MBProgressHUDModeCustomView;
[HUD hide:YES afterDelay:2];
- [connection release];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
[HUD hide:YES];
- [connection release];
}
#pragma mark -
View
1 Demo/HudDemo.xcodeproj/project.pbxproj
@@ -242,6 +242,7 @@
GCC_PREFIX_HEADER = HudDemo_Prefix.pch;
INFOPLIST_FILE = Info.plist;
PRODUCT_NAME = HudDemo;
+ SDKROOT = iphoneos;
};
name = Release;
};
View
2 MBProgressHUD.m
@@ -585,6 +585,7 @@ - (void)drawRect:(CGRect)rect {
CGFloat gradColors[8] = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.75f};
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, gradColors, gradLocations, gradLocationsNum);
+ CGColorSpaceRelease(colorSpace);
//Gradient center
CGPoint gradCenter= CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
@@ -594,6 +595,7 @@ - (void)drawRect:(CGRect)rect {
CGContextDrawRadialGradient (context, gradient, gradCenter,
0, gradCenter, gradRadius,
kCGGradientDrawsAfterEndLocation);
+ CGGradientRelease(gradient);
}
// Center HUD

0 comments on commit 3e3e361

Please sign in to comment.