Fix analyzer findings

This commit is contained in:
Jonathan Schleifer 2017-10-15 17:04:58 +02:00
parent 57c875987c
commit 9d8e6f6761
No known key found for this signature in database
GPG key ID: 28D65178B37F33E3
4 changed files with 24 additions and 6 deletions

View file

@ -46,7 +46,7 @@ static NSString *aboutHTMLTemplate =
@" scrypt-pwgen {version}" @" scrypt-pwgen {version}"
@"</div>" @"</div>"
@"<div id='copyright'>" @"<div id='copyright'>"
@" Copyright © 2016, Jonathan Schleifer" @" Copyright © 2016 - 2017, Jonathan Schleifer"
@"</div>" @"</div>"
@"<p name='free_software'>" @"<p name='free_software'>"
@" scrypt-pwgen is free software and the source code is available at " @" scrypt-pwgen is free software and the source code is available at "
@ -62,6 +62,8 @@ static NSString *aboutHTMLTemplate =
@implementation AboutController @implementation AboutController
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO; self.automaticallyAdjustsScrollViewInsets = NO;
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];

View file

@ -23,4 +23,10 @@
#import "AppDelegate.h" #import "AppDelegate.h"
@implementation AppDelegate @implementation AppDelegate
- (void)dealloc
{
[_window release];
[super dealloc];
}
@end @end

View file

@ -30,15 +30,18 @@
@implementation MainViewController @implementation MainViewController
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad];
_siteStorage = [[SiteStorage alloc] init]; _siteStorage = [[SiteStorage alloc] init];
[self reset]; [self reset];
} }
- (void)dealloc - (void)dealloc
{ {
[_siteStorage release];
[_tableView release];
[_sites release]; [_sites release];
[_siteStorage release];
[_searchBar release];
[_tableView release];
[super dealloc]; [super dealloc];
} }

View file

@ -58,15 +58,20 @@ clearNSMutableString(NSMutableString *string)
[_lengthField release]; [_lengthField release];
[_legacySwitch release]; [_legacySwitch release];
[_passphraseField release]; [_passphraseField release];
[_mainViewController release];
[super dealloc]; [super dealloc];
} }
- (void)viewWillAppear: (BOOL)animated - (void)viewWillAppear: (BOOL)animated
{ {
SiteStorage *siteStorage = self.mainViewController.siteStorage; SiteStorage *siteStorage;
NSIndexPath *indexPath = NSIndexPath *indexPath;
self.mainViewController.tableView.indexPathForSelectedRow;
[super viewWillAppear: animated];
siteStorage = self.mainViewController.siteStorage;
indexPath = self.mainViewController.tableView.indexPathForSelectedRow;
[_name release]; [_name release];
_name = [self.mainViewController.sites[indexPath.row] retain]; _name = [self.mainViewController.sites[indexPath.row] retain];
@ -83,6 +88,8 @@ clearNSMutableString(NSMutableString *string)
- (void)viewDidAppear: (BOOL)animated - (void)viewDidAppear: (BOOL)animated
{ {
[super viewDidAppear: animated];
[self.passphraseField becomeFirstResponder]; [self.passphraseField becomeFirstResponder];
} }