Fix ICE settings (stun must be activated when ICE is)

Fix small memory leak.
This commit is contained in:
Simon Morlat 2018-03-03 16:50:54 +01:00
parent 2fecb07356
commit d5e1b7eca2
3 changed files with 5 additions and 3 deletions

View file

@ -105,6 +105,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
}
- (void)loadData {
if (_data) bctbx_list_free(_data);
_data = [self sortChatRooms];
[super loadData];

View file

@ -491,7 +491,7 @@
BOOL use_avpf = [self boolForKey:@"account_avpf_preference"];
BOOL is_default = [self boolForKey:@"account_is_default_preference"];
BOOL is_enabled = [self boolForKey:@"account_is_enabled_preference"];
BOOL use_ise = [self boolForKey:@"account_ice_preference"];
BOOL use_ice = [self boolForKey:@"account_ice_preference"];
NSString *stun_preference = [self stringForKey:@"account_stun_preference"];
if (username && [username length] > 0 && domain && [domain length] > 0) {
@ -568,7 +568,8 @@
}
LinphoneNatPolicy *policy = linphone_proxy_config_get_nat_policy(proxyCfg) ?: linphone_core_create_nat_policy(LC);
linphone_nat_policy_enable_ice(policy, use_ise);
linphone_nat_policy_enable_stun(policy, use_ice); /*we always use STUN with ICE*/
linphone_nat_policy_enable_ice(policy, use_ice);
linphone_nat_policy_set_stun_server(policy, stun_preference.UTF8String);
linphone_proxy_config_set_nat_policy(proxyCfg, policy);

View file

@ -1959,7 +1959,7 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat
linphone_core_cbs_set_call_encryption_changed(cbs, linphone_iphone_call_encryption_changed);
linphone_core_cbs_set_chat_room_state_changed(cbs, linphone_iphone_chatroom_state_changed);
linphone_core_cbs_set_user_data(cbs, (__bridge void *)(self));
theLinphoneCore = linphone_factory_create_core_with_config(factory, cbs, _configDb);
// Let the core handle cbs
linphone_core_cbs_unref(cbs);