mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Remove retain / release / autorelease that were not watched
This commit is contained in:
parent
e3eaa693c2
commit
4a05213af1
4 changed files with 6 additions and 20 deletions
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue