From 4a05213af175570de97da349f5a50f99545a358b Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Tue, 2 Jun 2015 14:39:52 +0200 Subject: [PATCH] Remove retain / release / autorelease that were not watched --- Classes/InAppProductsManager.m | 14 +++++--------- Classes/InCallViewController.m | 7 ------- Classes/LinphoneManager.m | 1 - Classes/SettingsViewController.m | 4 +--- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/Classes/InAppProductsManager.m b/Classes/InAppProductsManager.m index 343624781..186d6f604 100644 --- a/Classes/InAppProductsManager.m +++ b/Classes/InAppProductsManager.m @@ -65,7 +65,7 @@ if (!_enabled) return FALSE; for (NSString *prod in _productsIDPurchased) { - NSDate *now = [[[NSDate alloc] init] autorelease]; + NSDate *now = [[NSDate alloc] init]; // since multiple ID represent the same product, we must not check it if (/*[prod isEqual: productID] &&*/[self.expirationDate earlierDate:now] == now) { bool isBought = true; @@ -101,7 +101,7 @@ - (BOOL)purchaseAccount:(NSString *)phoneNumber withPassword:(NSString *)password andEmail:(NSString*)email monthly:(BOOL)monthly { if (phoneNumber) { NSString* productID = [[LinphoneManager instance] lpConfigStringForKey:(monthly?@"paid_account_id_monthly":@"paid_account_id") forSection:@"in_app_purchase"]; - self.accountCreationData = @{ @"phoneNumber":[phoneNumber retain], @"password":[password retain], @"email":[email retain] }; + self.accountCreationData = @{ @"phoneNumber":phoneNumber, @"password":password, @"email":email }; if (![self purchaseWitID:productID]) { self.accountCreationData = nil; @@ -130,7 +130,6 @@ XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager]; [manager spawnConnectionWithXMLRPCRequest: request delegate: self.xmlrpc]; LOGI(@"XMLRPC query %@", [request method]); - [request release]; return true; } else { LOGE(@"Trying to activate account but no receipt available yet (probably doing it too soon)"); @@ -182,7 +181,7 @@ - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { - _productsAvailable = [[NSMutableArray arrayWithArray: response.products] retain]; + _productsAvailable = [NSMutableArray arrayWithArray: response.products]; LOGI(@"Found %lu products available", (unsigned long)_productsAvailable.count); _initialized = true; @@ -283,12 +282,11 @@ return; } } - latestReceiptMD5 = [[receiptBase64 md5] retain]; + latestReceiptMD5 = [receiptBase64 md5]; XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager]; [manager spawnConnectionWithXMLRPCRequest: request delegate: self.xmlrpc]; LOGI(@"XMLRPC query %@", [request method]); - [request release]; } else { LOGW(@"Not checking receipt since it has already been done!"); _available = true; @@ -393,7 +391,7 @@ double timeinterval = [[response object] doubleValue]; if (timeinterval != 0.0f) { self.expirationDate = [NSDate dateWithTimeIntervalSince1970:timeinterval/1000]; - NSDate *now = [[[NSDate alloc] init] autorelease]; + NSDate *now = [[NSDate alloc] init]; NSDictionary* dict = @{@"product_id": productID, @"expires_date": self.expirationDate}; if ([self.expirationDate earlierDate:now] == self.expirationDate) { LOGW(@"Account has expired"); @@ -437,7 +435,6 @@ cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; latestReceiptMD5 = nil; NSDictionary* dict = @{@"error_msg": errorString}; @@ -462,7 +459,6 @@ cancelButtonTitle:NSLocalizedString(@"Continue", nil) otherButtonTitles:nil,nil]; [errorView show]; - [errorView release]; latestReceiptMD5 = nil; NSDictionary* dict = @{@"error_msg": errorString}; [self postNotificationforStatus:kIAPReceiptFailed withDict:dict]; diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 06656d295..d6767e8a9 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -65,13 +65,6 @@ const NSInteger SECURE_BUTTON_TAG=5; } - (void)dealloc { - -#ifdef TEST_VIDEO_VIEW_CHANGE - [testVideoView release]; -#endif - - - [[PhoneMainView instance].view removeGestureRecognizer:singleFingerTap]; // Remove all observer diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 344a66f73..520465ad6 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -542,7 +542,6 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){ // [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneLogsUpdate object:[LinphoneManager instance] userInfo:dict]; // }); // -// [formatedString release]; } //Error/warning log handler diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 440afdd38..d1a07dec2 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -537,7 +537,7 @@ static UICompositeViewDescription *compositeDescription = nil; NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]]; [values removeObject:@"tls"]; [dict setObject:values forKey:@"Values"]; - return [[[IASKSpecifier alloc] initWithSpecifier:dict] autorelease]; + return [[IASKSpecifier alloc] initWithSpecifier:dict]; } #else if ([[specifier key] isEqualToString:@"media_encryption_preference"]) { @@ -808,7 +808,6 @@ static UICompositeViewDescription *compositeDescription = nil; [picker addAttachmentData:attachment mimeType:type fileName:attachmentName]; [self presentViewController:picker animated:true completion:nil]; - [picker release]; } else { UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot send email",nil) message:NSLocalizedString(@"Your device is not configured to send emails. Please configure mail application prior to send logs.",nil) @@ -816,7 +815,6 @@ static UICompositeViewDescription *compositeDescription = nil; cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil]; [error show]; - [error release]; } #endif }