Skip to content

Commit

Permalink
call: remove timers in pause and conference tables
Browse files Browse the repository at this point in the history
  • Loading branch information
bagage committed Jan 25, 2016
1 parent 619784b commit 0c0c9b2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 43 deletions.
7 changes: 3 additions & 4 deletions Classes/CallConferenceTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

#import <UIKit/UIKit.h>

@interface CallConferenceTableView : UITableViewController {
@private
NSTimer *updateTime;
}
@interface CallConferenceTableView : UITableViewController

- (void)update;

@end
16 changes: 0 additions & 16 deletions Classes/CallConferenceTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions Classes/CallPausedTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@

#import <UIKit/UIKit.h>

@interface CallPausedTableView : UITableViewController {
@private
NSTimer *updateTime;
}
@interface CallPausedTableView : UITableViewController

- (void)update;

@end
16 changes: 0 additions & 16 deletions Classes/CallPausedTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions Classes/CallView.m
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ - (void)callDurationUpdate {
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 {
Expand Down Expand Up @@ -513,8 +516,8 @@ - (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state animated:
}

// 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) {
Expand Down
2 changes: 1 addition & 1 deletion linphone-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4</string>
<string>5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationExitsOnSuspend</key>
Expand Down

0 comments on commit 0c0c9b2

Please sign in to comment.