call: remove timers in pause and conference tables

This commit is contained in:
Gautier Pelloux-Prayer 2016-01-25 14:14:20 +01:00
parent 619784bfad
commit 0c0c9b2acb
6 changed files with 12 additions and 43 deletions

View file

@ -8,9 +8,8 @@
#import <UIKit/UIKit.h>
@interface CallConferenceTableView : UITableViewController {
@private
NSTimer *updateTime;
}
@interface CallConferenceTableView : UITableViewController
- (void)update;
@end

View file

@ -24,22 +24,6 @@
@implementation CallConferenceTableView
#pragma mark - ViewController Functions
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
updateTime =
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(update) userInfo:nil repeats:YES];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if (updateTime != nil) {
[updateTime invalidate];
updateTime = nil;
}
}
#pragma mark - UI change
- (void)update {

View file

@ -19,9 +19,8 @@
#import <UIKit/UIKit.h>
@interface CallPausedTableView : UITableViewController {
@private
NSTimer *updateTime;
}
@interface CallPausedTableView : UITableViewController
- (void)update;
@end

View file

@ -24,22 +24,6 @@
@implementation CallPausedTableView
#pragma mark - ViewController Functions
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
updateTime =
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(update) userInfo:nil repeats:YES];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if (updateTime != nil) {
[updateTime invalidate];
updateTime = nil;
}
}
#pragma mark - UI change
- (void)update {

View file

@ -415,6 +415,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
int duration =
linphone_core_get_current_call(LC) ? linphone_call_get_duration(linphone_core_get_current_call(LC)) : 0;
_durationLabel.text = [LinphoneUtils durationToString:duration];
[_pausedCallsTable update];
[_conferenceCallsTable update];
}
- (void)onCurrentCallChange {
@ -513,8 +516,8 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
}
// Update tables
[_pausedCallsTable.tableView reloadData];
[_conferenceCallsTable.tableView reloadData];
[_pausedCallsTable update];
[_conferenceCallsTable update];
static LinphoneCall *currentCall = NULL;
if (!currentCall || linphone_core_get_current_call(LC) != currentCall) {

View file

@ -53,7 +53,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4</string>
<string>5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationExitsOnSuspend</key>