Developer Area

Changeset 626

Show
Ignore:
Timestamp:
01/11/10 11:17:57 (2 months ago)
Author:
henri
Message:

App-wide bug fixing based on static analyser report

Location:
apps/iphone
Files:
14 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/AccountEditController.m

    r612 r626  
    180180- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    181181         
    182         TextFieldCell *cell; 
     182        TextFieldCell *cell = nil; 
    183183        switch (indexPath.section) { 
    184184                case 0: 
     
    254254        // show an activity indicator, as we might get the api root url from the network, which may take time 
    255255        UIBarButtonItem *origButton = [self.navigationItem.rightBarButtonItem retain]; 
    256         UIActivityIndicatorView *uiAIV = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 
     256        UIActivityIndicatorView *uiAIV = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease]; 
    257257        uiAIV.hidesWhenStopped = YES; 
    258258        self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:uiAIV] autorelease]; 
     
    284284        // try to autoprovision apiRootUrl 
    285285        [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 
    286         NSMutableArray *naptrArray = [[NSMutableArray arrayWithCapacity:1] retain]; 
     286        NSMutableArray *naptrArray = [NSMutableArray arrayWithCapacity:1]; 
    287287        NSString *autoProvisionDomain = [@"_https._nsp._apps." stringByAppendingString:aDomain]; 
    288288        DnsResolver *resolver =[[DnsResolver alloc] init]; 
  • apps/iphone/my.tel/trunk/Classes/AccountViewController.m

    r612 r626  
    244244                        // Delete the row from the data source 
    245245                        self; 
    246                         alert = [AlertRenameView alloc]; 
    247                         [[alert initWithTitle:@"Confirm Deletion"  
     246                        alert = [[AlertRenameView alloc] initWithTitle:@"Confirm Deletion"  
    248247                                                  message:@"Are you sure you want to remove this account?" 
    249248                                                 delegate:self 
    250249                                cancelButtonTitle:@"Cancel" 
    251                                 otherButtonTitles:@"Remove", nil] autorelease]; 
     250                                otherButtonTitles:@"Remove", nil]; 
    252251                        alert.alertId = [NSNumber numberWithInt:0]; 
    253252                        alert.refObject = self; 
    254253                        ((UITextField *)alert.uiStringField).hidden = YES; 
    255254                        [alert show]; 
     255                        [alert release]; 
    256256                        break;                   
    257257                default: 
  • apps/iphone/my.tel/trunk/Classes/API Classes/JsonConnection.m

    r612 r626  
    129129                        NSLog(@"Connection error for URL: %@", [connectionUrl description]); 
    130130#endif 
    131                         UIAlertView *alert = [UIAlertView alloc]; 
    132                         [[alert initWithTitle:@"Error in connection"  
     131                        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error in connection"  
    133132                                                  message:@"Couldn't create a connection" 
    134133                                                 delegate:self 
    135134                                cancelButtonTitle:nil  
    136                                 otherButtonTitles:@"OK", nil] autorelease]; 
     135                                otherButtonTitles:@"OK", nil]; 
    137136                        [alert show]; 
     137                        [alert release]; 
    138138                } 
    139139                return NULL; 
     
    156156                        NSLog(@"Connection error for URL: %@", [connectionUrl description]); 
    157157#endif 
    158                         UIAlertView *alert = [UIAlertView alloc]; 
    159                         [[alert initWithTitle:@"Error in connection"  
     158                        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error in connection"  
    160159                                                  message:[error localizedDescription] 
    161160                                                 delegate:self 
    162161                                cancelButtonTitle:nil  
    163                                 otherButtonTitles:@"Quit", nil] autorelease]; 
     162                                otherButtonTitles:@"Quit", nil]; 
    164163                        [alert show]; 
     164                        [alert release]; 
    165165                } 
    166166                NSString *theJSONResult; 
     
    253253 
    254254+ (void)throwJsonErrorAlert:(NSDictionary *)someJson { 
    255         UIAlertView *alert = [UIAlertView alloc]; 
    256         [[alert initWithTitle:@"Error"  
     255        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"  
    257256                                  message:[[(NSArray *)[someJson valueForKey:@"actionErrors"] objectAtIndex:0] description] 
    258257                                 delegate:self 
    259258                cancelButtonTitle:nil  
    260                 otherButtonTitles:@"OK", nil] autorelease]; 
     259                otherButtonTitles:@"OK", nil]; 
    261260        [alert show];            
     261        [alert release]; 
    262262} 
    263263 
  • apps/iphone/my.tel/trunk/Classes/DomainViewController.m

    r612 r626  
    332332        // Delete the row from the data source 
    333333                if (indexPath.section == [self sectionForIndex:kKDomainTableViewSectionFolders]) { 
    334                         AlertRenameView *alert = [AlertRenameView alloc]; 
    335                         [[alert initWithTitle:@"Confirm Deletion"  
     334                        AlertRenameView *alert = [[AlertRenameView alloc] initWithTitle:@"Confirm Deletion"  
    336335                                                  message:@"All information contained in this folder will be permanently deleted!" 
    337336                                                 delegate:self 
    338337                                cancelButtonTitle:@"Cancel" 
    339                                 otherButtonTitles:@"Delete", nil] autorelease]; 
     338                                otherButtonTitles:@"Delete", nil]; 
    340339                        alert.alertId = [NSNumber numberWithInt:kKDomainTableViewAlertDelete]; 
    341340                        alert.refObject = indexPath; 
    342341                        ((UITextField *)alert.uiStringField).hidden = YES; 
    343342                        [alert show]; 
     343                        [alert release]; 
    344344                } 
    345345        } else if (editingStyle == UITableViewCellEditingStyleInsert) { 
    346346                if (indexPath.section == [self sectionForIndex:kKDomainTableViewSectionAddFolder]) { 
    347                         AlertRenameView *alert = [AlertRenameView alloc]; 
    348                         [[alert initWithTitle:@"New Folder Name"  
     347                        AlertRenameView *alert = [[AlertRenameView alloc] initWithTitle:@"New Folder Name"  
    349348                                                  message:@"\n\n" 
    350349                                                 delegate:self 
    351350                                cancelButtonTitle:@"Cancel" 
    352                                 otherButtonTitles:@"OK", nil] autorelease]; 
     351                                otherButtonTitles:@"OK", nil]; 
    353352                        alert.alertId = [NSNumber numberWithInt:kKDomainTableViewAlertAdd]; 
    354353                        alert.uiStringField.text = @""; 
    355354                        [alert show]; 
     355                        [alert release]; 
    356356                }                        
    357357    }    
     
    626626 
    627627- (void)dataDidChangeInController:(UIViewController *)controller { 
    628         UITableViewCell *theCell; 
     628        UITableViewCell *theCell = nil; 
    629629        if ([controller isMemberOfClass:[RecordViewController class]]) { 
    630630                NSIndexPath *thePath = [NSIndexPath indexPathForRow:0 inSection:[self sectionForIndex:kKDomainTableViewSectionInfo]]; 
     
    655655                theCell.detailTextLabel.text = [NSString stringWithFormat:@"(%d)", [((GroupsViewController *)controller).groupsArray count]]; 
    656656        } 
    657          
    658         [theCell setNeedsLayout]; 
     657        if (theCell != nil) { 
     658                [theCell setNeedsLayout]; 
     659                [theCell setNeedsDisplay]; 
     660        } 
    659661} 
    660662 
  • apps/iphone/my.tel/trunk/Classes/GroupFriendsController.m

    r623 r626  
    8080        [conn setPayload:requestData]; 
    8181        [conn performLookup:TRUE]; 
     82        [requestData release]; 
    8283        [newName release]; 
    8384} 
     
    9091 
    9192- (IBAction)didClickRename:(id)sender { 
    92         AlertRenameView *alert = [AlertRenameView alloc]; 
    93         [[alert initWithTitle:@"Rename Group"  
     93        AlertRenameView *alert = [[AlertRenameView alloc] initWithTitle:@"Rename Group"  
    9494                                  message:@"\n\n" 
    9595                                 delegate:self 
    9696                cancelButtonTitle:@"Cancel" 
    97                 otherButtonTitles:@"OK", nil] autorelease]; 
     97                otherButtonTitles:@"OK", nil]; 
    9898        alert.alertId = [NSNumber numberWithInt:kAlertRenameId]; 
    9999        alert.uiStringField.text = [theGroup objectForKey:@"name"]; 
    100100        [alert show];    
     101        [alert release]; 
    101102} 
    102103 
  • apps/iphone/my.tel/trunk/Classes/GroupsViewController.m

    r623 r626  
    156156 
    157157- (IBAction)didClickAdd:(id)sender { 
    158         AlertRenameView *alert = [AlertRenameView alloc]; 
    159         [[alert initWithTitle:@"New Group Name"  
     158        AlertRenameView *alert = [[AlertRenameView alloc] initWithTitle:@"New Group Name"  
    160159                                  message:@"\n\n" 
    161160                                 delegate:self 
    162161                cancelButtonTitle:@"Cancel" 
    163                 otherButtonTitles:@"OK", nil] autorelease]; 
     162                otherButtonTitles:@"OK", nil]; 
    164163        alert.alertId = [NSNumber numberWithInt:kAlertAddId]; 
    165164        alert.uiStringField.text = @""; 
    166165        [alert show]; 
     166        [alert release]; 
    167167} 
    168168 
     
    183183         
    184184        [conn setPayload:requestData]; 
     185        [aGroup release]; 
    185186        NSDictionary *parsedJson = [conn performLookup:FALSE]; 
    186187        [requestData release]; 
  • apps/iphone/my.tel/trunk/Classes/KeywordEditController.h

    r622 r626  
    3939        id <KeywordEditDelegate> delegate; 
    4040@private 
    41         NSMutableArray *tArrKey; 
    42         NSMutableArray *tArrVal; 
    4341        UIBarButtonItem *buttonSave; 
    4442        BOOL isEditing; 
  • apps/iphone/my.tel/trunk/Classes/KeywordEditController.m

    r622 r626  
    258258 
    259259        // Store the record 
    260         UIActivityIndicatorView *uiAIV = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 
     260        UIActivityIndicatorView *uiAIV = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease]; 
    261261        self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:uiAIV] autorelease]; 
    262262        // yield to runloop for the activity indicator to display 
  • apps/iphone/my.tel/trunk/Classes/MyCLController.m

    r593 r626  
    109109     
    110110        // TODO: Send the delegate the alert? 
     111        if (shouldQuit) { 
     112                // do nothing 
     113        } 
    111114} 
    112115 
  • apps/iphone/my.tel/trunk/Classes/ProfileRecordsViewController.h

    r618 r626  
    4444        id <TelControllerDelegate> delegate; 
    4545@private 
    46         RecordEditController *editController; 
    4746        NSUInteger buttonEditCount; 
    4847        BOOL didPreload; 
  • apps/iphone/my.tel/trunk/Classes/ProfileRecordsViewController.m

    r618 r626  
    331331 
    332332- (IBAction)didClickRename:(id)sender { 
    333         AlertRenameView *alert = [AlertRenameView alloc]; 
    334         [[alert initWithTitle:@"Edit Profile Name"  
     333        AlertRenameView *alert = [[AlertRenameView alloc] initWithTitle:@"Edit Profile Name"  
    335334                                  message:@"\n\n" 
    336335                                 delegate:self 
    337336                cancelButtonTitle:@"Cancel" 
    338                 otherButtonTitles:@"OK", nil] autorelease]; 
     337                otherButtonTitles:@"OK", nil]; 
    339338        alert.alertId = [NSNumber numberWithInt:0]; 
    340339        alert.uiStringField.text = [self.theProfile objectForKey:@"name"]; 
    341340        [alert show]; 
     341        [alert release]; 
    342342} 
    343343 
  • apps/iphone/my.tel/trunk/Classes/ProfileViewController.m

    r624 r626  
    155155 
    156156- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 
    157         NSDictionary *aProf = [[profilesArray objectAtIndex:indexPath.row] retain]; 
     157        NSDictionary *aProf = [profilesArray objectAtIndex:indexPath.row]; 
    158158        if ([[aProf objectForKey:@"isDefault"] integerValue] == 1) { 
    159159                return UITableViewCellEditingStyleNone; 
     
    207207 
    208208- (IBAction)didClickAdd:(id)sender { 
    209         AlertRenameView *alert = [AlertRenameView alloc]; 
    210         [[alert initWithTitle:@"New Profile Name"  
     209        AlertRenameView *alert = [[AlertRenameView alloc] initWithTitle:@"New Profile Name"  
    211210                                  message:@"\n\n" 
    212211                                 delegate:self 
    213212                cancelButtonTitle:@"Cancel" 
    214                 otherButtonTitles:@"OK", nil] autorelease]; 
     213                otherButtonTitles:@"OK", nil]; 
    215214        alert.alertId = [NSNumber numberWithInt:0]; 
    216215        alert.uiStringField.text = @""; 
    217216        [alert show]; 
     217        [alert release]; 
    218218} 
    219219 
  • apps/iphone/my.tel/trunk/Classes/RootViewController.m

    r621 r626  
    324324        if (editingStyle == UITableViewCellEditingStyleDelete) { 
    325325        // Delete the row from the data source 
    326                 AlertRenameView *alert = [AlertRenameView alloc]; 
    327                 [[alert initWithTitle:@"Confirm Deletion"  
     326                AlertRenameView *alert = [[AlertRenameView alloc] initWithTitle:@"Confirm Deletion"  
    328327                                          message:@"Are you sure you want to remove this account?" 
    329328                                         delegate:self 
    330329                        cancelButtonTitle:@"Cancel" 
    331                         otherButtonTitles:@"Remove", nil] autorelease]; 
     330                        otherButtonTitles:@"Remove", nil]; 
    332331                alert.alertId = [NSNumber numberWithInt:0]; 
    333332                alert.refObject = indexPath; 
    334333                ((UITextField *)alert.uiStringField).hidden = YES; 
    335334                [alert show]; 
     335                [alert release]; 
    336336        } 
    337337} 
  • apps/iphone/superbook/trunk/DotTel_SDK/Classes/DnsResolver.m

    r546 r626  
    5353        NSLog(@"Domain %@: Retrieving NAPTR Records", domain); 
    5454#endif 
     55        [naptrArray retain]; 
    5556        ldns_rr_list *naptrs = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_NAPTR fromDomain:domain withError:error]; 
    5657        if (!naptrs) { 
     58                [naptrArray release]; 
    5759                return 0; 
    5860        } 
     
    7476        ldns_rr_list_deep_free(naptrs); 
    7577        [lookupDate release]; 
    76          
     78        [naptrArray release]; 
    7779        return count; 
    7880         
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us