From e6045a2c60f90851a98c544373d02ce3b6e8954d Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 10 Jul 2014 13:31:50 +0200 Subject: [PATCH] Removed / corrected code spotted by static analysis --- Classes/ChatRoomTableViewController.m | 1 + Classes/ChatRoomViewController.m | 2 +- Classes/HistoryDetailsViewController.m | 12 ------------ Classes/LinphoneManager.m | 1 + Classes/LinphoneUI/UIChatRoomCell.m | 2 ++ .../Controllers/IASKSpecifierValuesViewController.m | 1 + 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 323c6943a..6533dbfc1 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -47,6 +47,7 @@ // chatRoom = NULL; } - (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; [self reloadData]; } diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index a40462b45..026e1fc87 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -240,10 +240,10 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; - } -(void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; [TUNinePatchCache flushCache]; // will remove any images cache (freeing any cached but unused images) } diff --git a/Classes/HistoryDetailsViewController.m b/Classes/HistoryDetailsViewController.m index dfaf43580..108848ba9 100644 --- a/Classes/HistoryDetailsViewController.m +++ b/Classes/HistoryDetailsViewController.m @@ -385,18 +385,6 @@ static UICompositeViewDescription *compositeDescription = nil; if(lAddress == NULL) return; - NSString *displayName = nil; - if(contact != nil) { - displayName = [FastAddressBook getContactDisplayName:contact]; - } else { - const char* lDisplayName = linphone_address_get_display_name(addr); - const char* lUserName = linphone_address_get_username(addr); - if (lDisplayName) - displayName = [NSString stringWithUTF8String:lDisplayName]; - else if(lUserName) - displayName = [NSString stringWithUTF8String:lUserName]; - } - // Go to ChatRoom view [[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]]; ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 34dc82399..24eeab399 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1890,6 +1890,7 @@ static void audioRouteChangeListenerCallback ( NSData* data = [NSJSONSerialization dataWithJSONObject:appDataDict options:0 error:nil]; NSString* appdataJSON = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; linphone_chat_message_set_appdata(msg, [appdataJSON UTF8String] ); + [appdataJSON release]; } #pragma mark - LPConfig Functions diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index eea11e183..19561be8b 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -140,6 +140,8 @@ static UIFont *CELL_FONT = nil; [messageImageView stopLoading]; [image release]; }); + } else { + [image release]; } }); } failureBlock:^(NSError *error) { diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m b/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m index bd0b82ac6..d5d9449b4 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m @@ -105,6 +105,7 @@ } - (void)viewDidUnload { + [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; self.tableView = nil;