fixed memory leaks
This commit is contained in:
parent
4216237c0f
commit
9a492d8418
57 changed files with 48 additions and 3229 deletions
|
@ -128,7 +128,6 @@ enum JPImagePickerControllerPreviewImageSize {
|
|||
|
||||
@interface JPImagePickerController : UIViewController {
|
||||
IBOutlet UINavigationController *modalNavigationController;
|
||||
JPImagePickerOverviewController *overviewController;
|
||||
UIStatusBarStyle originalStatusBarStyle;
|
||||
id<JPImagePickerControllerDelegate> delegate;
|
||||
id<JPImagePickerControllerDataSource> dataSource;
|
||||
|
@ -168,7 +167,7 @@ enum JPImagePickerControllerPreviewImageSize {
|
|||
If this property is nil, the picker is dismissed immediately if you try
|
||||
to show it.
|
||||
*/
|
||||
@property (nonatomic, retain) id<JPImagePickerControllerDelegate> delegate;
|
||||
@property (nonatomic, assign) id<JPImagePickerControllerDelegate> delegate;
|
||||
|
||||
/*!
|
||||
@property dataSource
|
||||
|
@ -177,7 +176,7 @@ enum JPImagePickerControllerPreviewImageSize {
|
|||
and implement the required methods to return the number of components and the
|
||||
number of rows in each component.
|
||||
*/
|
||||
@property (nonatomic, retain) id<JPImagePickerControllerDataSource> dataSource;
|
||||
@property (nonatomic, assign) id<JPImagePickerControllerDataSource> dataSource;
|
||||
|
||||
/*!
|
||||
@property imagePickerTitle
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
@implementation JPImagePickerController
|
||||
|
||||
@synthesize overviewController, modalNavigationController, delegate, dataSource, originalStatusBarStyle;
|
||||
@synthesize overviewController, modalNavigationController, delegate, dataSource, originalStatusBarStyle, imagePickerTitle;
|
||||
|
||||
/*
|
||||
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
|
||||
|
@ -24,6 +24,13 @@
|
|||
}
|
||||
*/
|
||||
|
||||
- (void)dealloc {
|
||||
[overviewController release];
|
||||
[modalNavigationController release];
|
||||
[imagePickerTitle release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
|
@ -41,8 +48,13 @@
|
|||
}
|
||||
|
||||
- (void)setImagePickerTitle:(NSString *)newTitle {
|
||||
imagePickerTitle = newTitle;
|
||||
[overviewController setImagePickerTitle:newTitle];
|
||||
if (newTitle != self.imagePickerTitle) {
|
||||
[imagePickerTitle release];
|
||||
imagePickerTitle = newTitle;
|
||||
[imagePickerTitle retain];
|
||||
[overviewController setImagePickerTitle:newTitle];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (NSString *)imagePickerTitle {
|
||||
|
@ -94,10 +106,4 @@
|
|||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -28,6 +28,13 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[previewImageView release];
|
||||
[overviewController release];
|
||||
[largeImage release];
|
||||
[scrollView release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
|
@ -75,9 +82,11 @@
|
|||
imageForImageNumber:imageNumber]
|
||||
scaleToSize:CGSizeMake(kJPImagePickerControllerPreviewImageSizeWidth, kJPImagePickerControllerPreviewImageSizeHeight)
|
||||
onlyIfNeeded:YES];
|
||||
previewImageView = [[UIImageView alloc] initWithImage:image];
|
||||
|
||||
self.previewImageView = [[UIImageView alloc] initWithImage:image];
|
||||
|
||||
largeImage = image;
|
||||
self.largeImage = image;
|
||||
|
||||
//Center the image code
|
||||
CGRect frameToCenter = previewImageView.frame;
|
||||
CGSize boundsSize = CGSizeMake(kJPImagePickerControllerPreviewImageSizeWidth, kJPImagePickerControllerPreviewImageSizeHeight);
|
||||
|
@ -97,7 +106,7 @@
|
|||
//Create Scroll view and add the ImageViewController.
|
||||
scrollView.contentSize = CGSizeMake(kJPImagePickerControllerPreviewImageSizeWidth, kJPImagePickerControllerPreviewImageSizeHeight);
|
||||
[scrollView addSubview:previewImageView];
|
||||
[previewImageView release];
|
||||
|
||||
scrollView.minimumZoomScale = 0.4;
|
||||
scrollView.maximumZoomScale = 8.0;
|
||||
scrollView.delegate = self;
|
||||
|
@ -162,10 +171,4 @@
|
|||
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -22,10 +22,18 @@
|
|||
if (self = [super initWithNibName:@"JPImagePickerOverviewController" bundle:nil]) {
|
||||
// Custom initialization
|
||||
imagePickerController = newImagePickerController;
|
||||
[imagePickerController retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[imagePickerController release];
|
||||
[detailController release];
|
||||
[scrollView release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
|
@ -121,12 +129,4 @@
|
|||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[imagePickerController release];
|
||||
[detailController release];
|
||||
[scrollView release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
Reference in a new issue