From 6f82cf7f154f653a0989f9bc0f5cf8663d2f66c6 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Fri, 7 Sep 2012 23:55:12 +0200 Subject: [PATCH] Fixed crashes related to over-released gesture recognizers. [FIXED] Memory warnings caused Master Password to crash due to gesture recognizers and an iOS 5 bug. --- External/Pearl | 2 +- MasterPassword/iOS/MPAppsViewController.m | 6 --- MasterPassword/iOS/MPGuideViewController.m | 7 ---- MasterPassword/iOS/MPMainViewController.h | 2 + MasterPassword/iOS/MPMainViewController.m | 39 +------------------ .../iOS/MPPreferencesViewController.m | 12 ------ MasterPassword/iOS/MPSearchDelegate.m | 2 +- MasterPassword/iOS/MPTypeViewController.m | 5 --- MasterPassword/iOS/MPUnlockViewController.m | 20 ---------- .../iOS/MainStoryboard_iPhone.storyboard | 6 +++ 10 files changed, 12 insertions(+), 89 deletions(-) diff --git a/External/Pearl b/External/Pearl index 76b758a9..4ceb992d 160000 --- a/External/Pearl +++ b/External/Pearl @@ -1 +1 @@ -Subproject commit 76b758a9df0ffa49c0a60360a76564287845c22c +Subproject commit 4ceb992dc59e9d085b241239b63df4754da90de7 diff --git a/MasterPassword/iOS/MPAppsViewController.m b/MasterPassword/iOS/MPAppsViewController.m index 68a1a06f..5345bc59 100644 --- a/MasterPassword/iOS/MPAppsViewController.m +++ b/MasterPassword/iOS/MPAppsViewController.m @@ -99,12 +99,6 @@ return [self.pageVCs objectAtIndex:(vcIndex + 1) % self.pageVCs.count]; } -- (void)viewDidUnload { - - [self setPagePositionView:nil]; - [super viewDidUnload]; -} - - (IBAction)exit { [self dismissViewControllerAnimated:YES completion:nil]; diff --git a/MasterPassword/iOS/MPGuideViewController.m b/MasterPassword/iOS/MPGuideViewController.m index 8781b612..6f10409e 100644 --- a/MasterPassword/iOS/MPGuideViewController.m +++ b/MasterPassword/iOS/MPGuideViewController.m @@ -48,13 +48,6 @@ [super viewWillDisappear:animated]; } -- (void)viewDidUnload { - - [self setScrollView:nil]; - [self setPageControl:nil]; - [super viewDidUnload]; -} - - (IBAction)close { [self.presentingViewController dismissModalViewControllerAnimated:YES]; diff --git a/MasterPassword/iOS/MPMainViewController.h b/MasterPassword/iOS/MPMainViewController.h index 8c2bfaa8..b057c067 100644 --- a/MasterPassword/iOS/MPMainViewController.h +++ b/MasterPassword/iOS/MPMainViewController.h @@ -16,6 +16,8 @@ @property (assign, nonatomic) BOOL siteInfoHidden; @property (strong, nonatomic) MPElementEntity *activeElement; @property (strong, nonatomic) IBOutlet MPSearchDelegate *searchDelegate; +@property (strong, nonatomic) IBOutlet UIPanGestureRecognizer *pullDownGesture; +@property (strong, nonatomic) IBOutlet UIPanGestureRecognizer *pullUpGesture; @property (weak, nonatomic) IBOutlet UITextField *contentField; @property (weak, nonatomic) IBOutlet UIButton *typeButton; @property (weak, nonatomic) IBOutlet UIWebView *helpView; diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index fac168f8..2d8138a4 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -17,6 +17,8 @@ @synthesize siteInfoHidden = _siteInfoHidden; @synthesize activeElement = _activeElement; @synthesize searchDelegate = _searchDelegate; +@synthesize pullDownGesture = _pullDownGesture; +@synthesize pullUpGesture = _pullUpGesture; @synthesize typeButton = _typeButton; @synthesize helpView = _helpView; @synthesize siteName = _siteName; @@ -211,43 +213,6 @@ [super viewWillDisappear:animated]; } -- (void)viewDidUnload { - - [self setContentField:nil]; - [self setTypeButton:nil]; - [self setHelpView:nil]; - [self setSiteName:nil]; - [self setPasswordCounter:nil]; - [self setPasswordIncrementer:nil]; - [self setPasswordEdit:nil]; - [self setPasswordUpgrade:nil]; - [self setContentContainer:nil]; - [self setHelpContainer:nil]; - [self setContentTipContainer:nil]; - [self setAlertContainer:nil]; - [self setAlertTitle:nil]; - [self setAlertBody:nil]; - [self setContentTipBody:nil]; - [self setToolTipEditIcon:nil]; - [self setSearchTipContainer:nil]; - [self setActionsTipContainer:nil]; - [self setTypeTipContainer:nil]; - [self setToolTipContainer:nil]; - [self setToolTipBody:nil]; - [self setDisplayContainer:nil]; - [self setLoginNameField:nil]; - [self setLoginNameTipContainer:nil]; - [self setLoginNameTipBody:nil]; - [self setLoginNameContainer:nil]; - [self setPasswordUser:nil]; - [self setOutdatedAlertContainer:nil]; - [self setOutdatedAlertCloseButton:nil]; - [self setOutdatedAlertBack:nil]; - [self setPullUpView:nil]; - [self setPullDownView:nil]; - [super viewDidUnload]; -} - - (void)updateAnimated:(BOOL)animated { if (animated) { diff --git a/MasterPassword/iOS/MPPreferencesViewController.m b/MasterPassword/iOS/MPPreferencesViewController.m index f64170e4..df30826e 100644 --- a/MasterPassword/iOS/MPPreferencesViewController.m +++ b/MasterPassword/iOS/MPPreferencesViewController.m @@ -91,18 +91,6 @@ return (interfaceOrientation == UIInterfaceOrientationPortrait); } -- (void)viewDidUnload { - - [self setAvatarsView:nil]; - [self setAvatarTemplate:nil]; - [self setAvatarsView:nil]; - [self setSavePasswordSwitch:nil]; - [self setExportCell:nil]; - [self setChangeMPCell:nil]; - [self setDefaultTypeLabel:nil]; - [super viewDidUnload]; -} - - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"MP_ChooseType"]) diff --git a/MasterPassword/iOS/MPSearchDelegate.m b/MasterPassword/iOS/MPSearchDelegate.m index afc8dd2b..6c784f3e 100644 --- a/MasterPassword/iOS/MPSearchDelegate.m +++ b/MasterPassword/iOS/MPSearchDelegate.m @@ -30,7 +30,7 @@ - (id)init { - if (!([super init])) + if (!(self = [super init])) return nil; self.dateFormatter = [NSDateFormatter new]; diff --git a/MasterPassword/iOS/MPTypeViewController.m b/MasterPassword/iOS/MPTypeViewController.m index 03be68c6..4357d025 100644 --- a/MasterPassword/iOS/MPTypeViewController.m +++ b/MasterPassword/iOS/MPTypeViewController.m @@ -140,9 +140,4 @@ } } -- (void)viewDidUnload { - - [self setRecommendedTipContainer:nil]; - [super viewDidUnload]; -} @end diff --git a/MasterPassword/iOS/MPUnlockViewController.m b/MasterPassword/iOS/MPUnlockViewController.m index cd2d6661..fe9f5d1f 100644 --- a/MasterPassword/iOS/MPUnlockViewController.m +++ b/MasterPassword/iOS/MPUnlockViewController.m @@ -169,26 +169,6 @@ [super viewDidLoad]; } -- (void)viewDidUnload { - - [self setSpinner:nil]; - [self setPasswordField:nil]; - [self setPasswordView:nil]; - [self setAvatarsView:nil]; - [self setNameLabel:nil]; - [self setAvatarTemplate:nil]; - [self setTip:nil]; - [self setPasswordTipView:nil]; - [self setPasswordTipLabel:nil]; - [self setTargetedUserActionGesture:nil]; - [self setWordWall:nil]; - [self setCreatePasswordTipView:nil]; - [self setPasswordFieldLabel:nil]; - [self setLoadingUsersIndicator:nil]; - [self setUiContainer:nil]; - [super viewDidUnload]; -} - - (void)viewWillAppear:(BOOL)animated { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; diff --git a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard index dd38def2..1a12d4aa 100644 --- a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard +++ b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard @@ -1,6 +1,7 @@ + @@ -923,7 +924,9 @@ L4m3P4sSw0rD + + @@ -2140,6 +2143,7 @@ You could use the word wall for inspiration in finding a memorable master passw + @@ -2173,7 +2177,9 @@ You could use the word wall for inspiration in finding a memorable master passw + +