Commit 656ff43b authored by Simon Morlat's avatar Simon Morlat

fix most common warnings

parent 5805d4b1
......@@ -597,7 +597,7 @@ lpc_cmd_call(LinphoneCore *lc, char *args)
{
snprintf(callee_name,sizeof(callee_name),"%s",args);
}
linphone_call_params_destroy(cp);
linphone_call_params_unref(cp);
}
return 1;
}
......@@ -1981,7 +1981,7 @@ static int lpc_cmd_register(LinphoneCore *lc, char *args){
if ((from=linphone_address_new(identity))!=NULL){
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,passwd,NULL,NULL,linphone_address_get_username(from));
linphone_core_add_auth_info(lc,info);
linphone_address_destroy(from);
linphone_address_unref(from);
linphone_auth_info_destroy(info);
}
}
......@@ -2574,7 +2574,7 @@ static int lpc_cmd_camera(LinphoneCore *lc, char *args){
LinphoneCallParams *ncp=linphone_call_params_copy(cp);
linphone_call_params_enable_video(ncp,TRUE);
linphone_core_update_call(lc,call,ncp);
linphone_call_params_destroy (ncp);
linphone_call_params_unref (ncp);
linphonec_out("Trying to bring up video stream...\n");
}
}
......
......@@ -368,7 +368,7 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L
linphone_call_params_enable_early_media_sending(callparams, TRUE);
if (vcap_enabled) linphone_call_params_enable_video(callparams, TRUE);
linphone_core_accept_early_media_with_params(lc, call, callparams);
linphone_call_params_destroy(callparams);
linphone_call_params_unref(callparams);
}
break;
case LinphoneCallOutgoingInit:
......@@ -796,7 +796,7 @@ linphonec_finish(int exit_status)
stop_pipe_reader();
#endif /*_WIN32_WCE*/
linphone_core_destroy (linphonec);
linphone_core_unref (linphonec);
if (mylogfile != NULL && mylogfile != stdout)
{
......
......@@ -246,7 +246,7 @@ static char* _get_identity(const LinphoneAccountCreator *creator) {
addr = linphone_proxy_config_normalize_sip_uri(proxy, creator->username ? creator->username : creator->phone_number);
identity = linphone_address_as_string(addr);
linphone_address_destroy(addr);
linphone_address_unref(addr);
linphone_proxy_config_destroy(proxy);
}
return identity;
......@@ -550,7 +550,7 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
linphone_proxy_config_set_server_addr(cfg, tmp);
linphone_proxy_config_set_route(cfg, tmp);
ms_free(tmp);
linphone_address_destroy(addr);
linphone_address_unref(addr);
}
linphone_core_set_stun_server(creator->core, "stun.linphone.org");
linphone_core_set_firewall_policy(creator->core, LinphonePolicyUseIce);
......@@ -564,7 +564,7 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
linphone_address_get_domain(identity) // domain
);
linphone_core_add_auth_info(creator->core, info);
linphone_address_destroy(identity);
linphone_address_unref(identity);
if (linphone_core_add_proxy_config(creator->core, cfg) != -1) {
linphone_core_set_default_proxy(creator->core, cfg);
......
......@@ -163,7 +163,7 @@ bool_t linphone_address_equal(const LinphoneAddress *a1, const LinphoneAddress *
}
void linphone_address_destroy(LinphoneAddress *u){
sal_address_unref(u);
linphone_address_unref(u);
}
void linphone_address_set_password(LinphoneAddress *addr, const char *passwd){
......
......@@ -281,8 +281,8 @@ void linphone_call_log_unref(LinphoneCallLog *cl) {
******************************************************************************/
static void _linphone_call_log_destroy(LinphoneCallLog *cl) {
if (cl->from!=NULL) linphone_address_destroy(cl->from);
if (cl->to!=NULL) linphone_address_destroy(cl->to);
if (cl->from!=NULL) linphone_address_unref(cl->from);
if (cl->to!=NULL) linphone_address_unref(cl->to);
if (cl->refkey!=NULL) ms_free(cl->refkey);
if (cl->call_id) ms_free(cl->call_id);
if (cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]!=NULL) linphone_reporting_destroy(cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]);
......@@ -454,10 +454,10 @@ static int create_call_log(void *data, int argc, char **argv, char **colName) {
error:
if (from){
linphone_address_destroy(from);
linphone_address_unref(from);
}
if (to){
linphone_address_destroy(to);
linphone_address_unref(to);
}
ms_error("Bad call log at storage_id %u", storage_id);
return 0;
......
......@@ -340,7 +340,7 @@ bool_t linphone_call_params_video_multicast_enabled(const LinphoneCallParams *pa
* Constructor and destructor functions *
******************************************************************************/
static void _linphone_call_params_destroy(LinphoneCallParams *cp){
static void _linphone_call_params_unref(LinphoneCallParams *cp){
unsigned int i;
if (cp->record_file) ms_free(cp->record_file);
if (cp->custom_headers) sal_custom_header_free(cp->custom_headers);
......@@ -368,7 +368,7 @@ void linphone_call_params_destroy(LinphoneCallParams *cp) {
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneCallParams);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneCallParams, belle_sip_object_t,
(belle_sip_object_destroy_t)_linphone_call_params_destroy,
(belle_sip_object_destroy_t)_linphone_call_params_unref,
NULL, // clone
NULL, // marshal
FALSE
......
......@@ -334,13 +334,13 @@ static void call_received(SalOp *h){
ms_warning("Receiving a call while one with same address [%s] is initiated, refusing this one with busy message.",addr);
sal_call_decline(h,SalReasonBusy,NULL);
sal_op_release(h);
linphone_address_destroy(from_addr);
linphone_address_destroy(to_addr);
linphone_address_destroy(from_address_to_search_if_me);
linphone_address_unref(from_addr);
linphone_address_unref(to_addr);
linphone_address_unref(from_address_to_search_if_me);
ms_free(addr);
return;
} else if (from_address_to_search_if_me) {
linphone_address_destroy(from_address_to_search_if_me);
linphone_address_unref(from_address_to_search_if_me);
}
call=linphone_call_new_incoming(lc,from_addr,to_addr,h);
......@@ -748,7 +748,7 @@ static void call_updating(SalOp *op, bool_t is_update){
LinphoneCallParams *p=linphone_core_create_call_params(lc, NULL);
ms_message("Applying default policy for offering SDP on call [%p]",call);
linphone_call_set_new_params(call, p);
linphone_call_params_destroy(p);
linphone_call_params_unref(p);
}
linphone_call_make_local_media_description(call);
sal_call_set_local_media_description(call->op,call->localdesc);
......@@ -1127,7 +1127,7 @@ static void refer_received(Sal *sal, SalOp *op, const char *referto){
if(refer_to_addr) {
const char *tmp = linphone_address_get_method_param(refer_to_addr);
if(tmp) strncpy(method, tmp, sizeof(method));
linphone_address_destroy(refer_to_addr);
linphone_address_unref(refer_to_addr);
}
if (call && (strlen(method) == 0 || strcmp(method, "INVITE") == 0)) {
if (call->refer_to!=NULL){
......
......@@ -130,7 +130,7 @@ static void _linphone_chat_room_destroy(LinphoneChatRoom *cr) {
cr->lc->chatrooms = bctbx_list_remove(cr->lc->chatrooms, cr);
}
}
linphone_address_destroy(cr->peer_url);
linphone_address_unref(cr->peer_url);
if (cr->pending_message)
linphone_chat_message_destroy(cr->pending_message);
ms_free(cr->peer);
......@@ -243,7 +243,7 @@ static LinphoneChatRoom *_linphone_core_get_or_create_chat_room(LinphoneCore *lc
return NULL;
}
ret = _linphone_core_get_chat_room(lc, to_addr);
linphone_address_destroy(to_addr);
linphone_address_unref(to_addr);
if (!ret) {
ret = _linphone_core_create_chat_room_from_url(lc, to);
}
......@@ -405,7 +405,7 @@ void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatMessage
* BUG
* the file transfer message constructor sets the from, but doesn't do it as well as here.
*/
linphone_address_destroy(msg->from);
linphone_address_unref(msg->from);
}
msg->from = linphone_address_new(identity);
......@@ -660,7 +660,7 @@ LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const
linphone_chat_room_message_received(cr, lc, msg);
end:
linphone_address_destroy(addr);
linphone_address_unref(addr);
linphone_chat_message_unref(msg);
return reason;
}
......@@ -769,7 +769,7 @@ LinphoneReason linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op,
}
linphone_chat_message_unref(msg);
}
linphone_address_destroy(addr);
linphone_address_unref(addr);
return reason;
}
......@@ -864,7 +864,7 @@ LinphoneReason linphone_core_imdn_received(LinphoneCore *lc, SalOp *op, const Sa
if (cr != NULL) {
linphone_chat_room_notify_imdn(cr, imdn->content);
}
linphone_address_destroy(addr);
linphone_address_unref(addr);
return LinphoneReasonNone;
}
......@@ -1030,8 +1030,8 @@ static void linphone_chat_room_send_is_composing_notification(LinphoneChatRoom *
}
linphone_chat_message_unref(msg);
linphone_address_destroy(from_addr);
linphone_address_destroy(to_addr);
linphone_address_unref(from_addr);
linphone_address_unref(to_addr);
ms_free(content);
sal_op_unref(op);
}
......@@ -1182,8 +1182,8 @@ static void linphone_chat_message_send_imdn(LinphoneChatMessage *cm, enum ImdnTy
}
linphone_chat_message_unref(msg);
linphone_address_destroy(from_addr);
linphone_address_destroy(to_addr);
linphone_address_unref(from_addr);
linphone_address_unref(to_addr);
ms_free(content);
}
sal_op_unref(op);
......@@ -1259,7 +1259,7 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c
linphone_chat_message_set_from(msg, cr->peer_url);
if (msg->to)
linphone_address_destroy(msg->to);
linphone_address_unref(msg->to);
msg->to = call->dest_proxy ? linphone_address_clone(call->dest_proxy->identity_address) :
linphone_address_new(linphone_core_get_identity(lc));
msg->time = ms_time(0);
......@@ -1319,7 +1319,7 @@ int linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t character)
msg->time = ms_time(0);
msg->state = LinphoneChatMessageStateDisplayed;
msg->dir = LinphoneChatMessageOutgoing;
if (msg->from) linphone_address_destroy(msg->from);
if (msg->from) linphone_address_unref(msg->from);
msg->from = linphone_address_new(linphone_core_get_identity(lc));
msg->storage_id = linphone_chat_message_store(msg);
ms_free(msg->message);
......@@ -1441,7 +1441,7 @@ void linphone_chat_message_set_appdata(LinphoneChatMessage *msg, const char *dat
void linphone_chat_message_set_from_address(LinphoneChatMessage *msg, const LinphoneAddress *from) {
if (msg->from)
linphone_address_destroy(msg->from);
linphone_address_unref(msg->from);
msg->from = linphone_address_clone(from);
}
......@@ -1451,7 +1451,7 @@ const LinphoneAddress *linphone_chat_message_get_from_address(const LinphoneChat
void linphone_chat_message_set_to_address(LinphoneChatMessage *msg, const LinphoneAddress *to) {
if (msg->to)
linphone_address_destroy(msg->to);
linphone_address_unref(msg->to);
msg->to = linphone_address_clone(to);
}
......@@ -1552,9 +1552,9 @@ static void _linphone_chat_message_destroy(LinphoneChatMessage *msg) {
if (msg->appdata)
ms_free(msg->appdata);
if (msg->from)
linphone_address_destroy(msg->from);
linphone_address_unref(msg->from);
if (msg->to)
linphone_address_destroy(msg->to);
linphone_address_unref(msg->to);
if (msg->message_id)
ms_free(msg->message_id);
if (msg->custom_headers)
......
......@@ -404,7 +404,7 @@ int LocalConference::addParticipant(LinphoneCall *call) {
/*this will trigger a reINVITE that will later redraw the streams */
/*FIXME probably a bit too much to just redraw streams !*/
linphone_core_update_call(m_core,call,params);
linphone_call_params_destroy(params);
linphone_call_params_unref(params);
addLocalEndpoint();
}else{
ms_error("Call is in state %s, it cannot be added to the conference.",linphone_call_state_to_string(call->state));
......@@ -441,7 +441,7 @@ int LocalConference::removeFromConference(LinphoneCall *call, bool_t active){
}
ms_message("Updating call to actually remove from conference");
err=linphone_core_update_call(m_core,call,params);
linphone_call_params_destroy(params);
linphone_call_params_unref(params);
} else{
ms_message("Pausing call to actually remove from conference");
err=_linphone_core_pause_call(m_core,call);
......
......@@ -54,6 +54,13 @@ LinphoneFactory *linphone_factory_get(void) {
return _factory;
}
void linphone_factory_clean(void){
if (_factory){
belle_sip_object_unref(_factory);
_factory = NULL;
}
}
LinphoneCore *linphone_factory_create_core(const LinphoneFactory *factory, LinphoneCoreCbs *cbs,
const char *config_path, const char *factory_config_path) {
LpConfig *config = lp_config_new_with_factory(config_path, factory_config_path);
......
......@@ -483,7 +483,7 @@ const char * linphone_friend_list_get_rls_uri(const LinphoneFriendList *list) {
void linphone_friend_list_set_rls_uri(LinphoneFriendList *list, const char *rls_uri) {
LinphoneAddress *addr = rls_uri ? linphone_core_create_address(list->lc, rls_uri) : NULL;
linphone_friend_list_set_rls_address(list, addr);
if (addr) linphone_address_destroy(addr);
if (addr) linphone_address_unref(addr);
}
static LinphoneFriendListStatus _linphone_friend_list_add_friend(LinphoneFriendList *list, LinphoneFriend *lf, bool_t synchronize) {
......
......@@ -144,7 +144,7 @@ int main(int argc, char *argv[]){
linphone_proxy_config_set_server_addr(proxy_cfg,linphone_address_get_domain(from)); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_proxy_config_enable_publish(proxy_cfg,TRUE); /* enable presence satus publication for this proxy*/
linphone_address_destroy(from); /*release resource*/
linphone_address_unref(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
......
......@@ -136,7 +136,7 @@ int main(int argc, char *argv[]){
server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
linphone_address_unref(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
......
......@@ -77,7 +77,7 @@ int main(int argc, char *argv[]){
LinphoneCallParams *cp = linphone_core_create_call_params(lc, NULL);
linphone_call_params_enable_realtime_text(cp,TRUE); /*enable real time text*/
call=linphone_core_invite_with_params(lc,dest,cp);
linphone_call_params_destroy(cp);
linphone_call_params_unref(cp);
if (call==NULL){
printf("Could not place call to %s\n",dest);
goto end;
......
......@@ -109,7 +109,7 @@ int main(int argc, char *argv[]){
server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
linphone_address_unref(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
......
......@@ -228,7 +228,7 @@ static void linphone_ldap_contact_provider_handle_search_result( LinphoneLDAPCon
//ms_message("Added friend %s / %s", ldap_data.name, ldap_data.sip);
ms_free(ldap_data.sip);
ms_free(ldap_data.name);
linphone_address_destroy(la);
linphone_address_unref(la);
}
}
......
......@@ -894,7 +894,7 @@ void linphone_call_make_local_media_description(LinphoneCall *call) {
update_media_description_from_stun(md, &call->ac, &call->vc, &call->tc);
call->localdesc=md;
linphone_call_update_local_media_description_from_ice_or_upnp(call);
linphone_address_destroy(addr);
linphone_address_unref(addr);
if (old_md){
transfer_already_assigned_payload_types(old_md,md);
call->localdesc_changed=sal_media_description_equals(md,old_md);
......@@ -4696,7 +4696,7 @@ void linphone_call_set_contact_op(LinphoneCall* call) {
sal_address_clean((SalAddress*)contact); /* clean out contact_params that come from proxy config*/
sal_address_set_transport((SalAddress*)contact,tport);
sal_op_set_contact_address(call->op, contact);
linphone_address_destroy(contact);
linphone_address_unref(contact);
}
}
......
......@@ -2079,7 +2079,7 @@ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact) {
ms_free(lc->sip_conf.guessed_contact);
lc->sip_conf.guessed_contact=NULL;
}
linphone_address_destroy(ctt);
linphone_address_unref(ctt);
return 0;
}
......@@ -2110,7 +2110,7 @@ static void update_primary_contact(LinphoneCore *lc){
it won't work. But we prefer to return something in all cases. It at least shows username and ip address.*/
guessed=linphone_address_as_string(url);
lc->sip_conf.guessed_contact=guessed;
linphone_address_destroy(url);
linphone_address_unref(url);
}
const char *linphone_core_get_primary_contact(LinphoneCore *lc){
......@@ -2918,7 +2918,7 @@ LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *
ms_message("Starting new call to refered address %s",call->refer_to);
call->refer_pending=FALSE;
newcall=linphone_core_invite_with_params(lc,call->refer_to,cp);
linphone_call_params_destroy(cp);
linphone_call_params_unref(cp);
if (newcall) {
call->transfer_target=linphone_call_ref(newcall);
linphone_core_notify_refer_state(lc,call,newcall);
......@@ -3132,7 +3132,7 @@ LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url){
LinphoneCallParams *p=linphone_core_create_call_params(lc, NULL);
p->has_video &= !!lc->video_policy.automatically_initiate;
call=linphone_core_invite_with_params(lc,url,p);
linphone_call_params_destroy(p);
linphone_call_params_unref(p);
return call;
}
......@@ -3141,7 +3141,7 @@ LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *ur
if (addr){
LinphoneCall *call;
call=linphone_core_invite_address_with_params(lc,addr,p);
linphone_address_destroy(addr);
linphone_address_unref(addr);
return call;
}
return NULL;
......@@ -3152,7 +3152,7 @@ LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddr
LinphoneCallParams *p=linphone_core_create_call_params(lc, NULL);
p->has_video &= !!lc->video_policy.automatically_initiate;
call=linphone_core_invite_address_with_params (lc,addr,p);
linphone_call_params_destroy(p);
linphone_call_params_unref(p);
return call;
}
......@@ -3244,7 +3244,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
{
ms_warning("we had a problem in adding the call into the invite ... weird");
linphone_call_unref(call);
linphone_call_params_destroy(cp);
linphone_call_params_unref(cp);
return NULL;
}
......@@ -3294,7 +3294,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
}
if (real_url!=NULL) ms_free(real_url);
linphone_call_params_destroy(cp);
linphone_call_params_unref(cp);
return call;
}
......@@ -3314,7 +3314,7 @@ int linphone_core_transfer_call(LinphoneCore *lc, LinphoneCall *call, const char
real_url=linphone_address_as_string (real_parsed_url);
sal_call_refer(call->op,real_url);
ms_free(real_url);
linphone_address_destroy(real_parsed_url);
linphone_address_unref(real_parsed_url);
linphone_call_set_transfer_state(call, LinphoneCallOutgoingInit);
return 0;
}
......@@ -3349,7 +3349,7 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){
from_parsed=linphone_address_new(sal_op_get_from(call->op));
linphone_address_clean(from_parsed);
tmp=linphone_address_as_string(from_parsed);
linphone_address_destroy(from_parsed);
linphone_address_unref(from_parsed);
barmesg=ortp_strdup_printf("%s %s%s",tmp,_("is contacting you"),
(sal_call_autoanswer_asked(call->op)) ?_(" and asked autoanswer."):".");
linphone_core_notify_show_interface(lc);
......@@ -5927,7 +5927,7 @@ void sip_config_uninit(LinphoneCore *lc)
if (config->contact)
ms_free(config->contact);
if (lc->default_rls_addr)
linphone_address_destroy(lc->default_rls_addr);
linphone_address_unref(lc->default_rls_addr);
linphone_im_notif_policy_unref(lc->im_notif_policy);
}
......
......@@ -194,7 +194,7 @@ static int callback_all(void *data, int argc, char **argv, char **colName){
LinphoneAddress *addr = linphone_address_new(address);
if (addr){
linphone_core_get_chat_room(lc, addr);
linphone_address_destroy(addr);
linphone_address_unref(addr);
}
return 0;
}
......
......@@ -1302,14 +1302,14 @@ static void linphone_core_migrate_proxy_config(LinphoneCore *lc, LinphoneTranspo
tmp=linphone_address_as_string(proxy_addr);
linphone_proxy_config_set_server_addr(cfg,tmp);
ms_free(tmp);
linphone_address_destroy(proxy_addr);
linphone_address_unref(proxy_addr);
}
if (route_addr){
linphone_address_set_transport(route_addr,type);
tmp=linphone_address_as_string(route_addr);
linphone_proxy_config_set_route(cfg,tmp);
ms_free(tmp);
linphone_address_destroy(route_addr);
linphone_address_unref(route_addr);
}
}
}
......
......@@ -1547,7 +1547,7 @@ void linphone_subscription_new(LinphoneCore *lc, SalOp *op, const char *from){
linphone_core_add_subscriber(lc,tmp,op);
}
}
linphone_address_destroy(uri);
linphone_address_unref(uri);
ms_free(tmp);
}
......
......@@ -29,13 +29,13 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
/*store current config related to server location*/
static void linphone_proxy_config_store_server_config(LinphoneProxyConfig* cfg) {
if (cfg->saved_identity) linphone_address_destroy(cfg->saved_identity);
if (cfg->saved_identity) linphone_address_unref(cfg->saved_identity);
if (cfg->identity_address)
cfg->saved_identity = linphone_address_clone(cfg->identity_address);
else
cfg->saved_identity = NULL;
if (cfg->saved_proxy) linphone_address_destroy(cfg->saved_proxy);
if (cfg->saved_proxy) linphone_address_unref(cfg->saved_proxy);
if (cfg->reg_proxy)
cfg->saved_proxy = linphone_address_new(cfg->reg_proxy);
else
......@@ -52,7 +52,7 @@ LinphoneProxyConfigAddressComparisonResult linphone_proxy_config_address_equal(c
return LinphoneProxyConfigAddressEqual;
if (linphone_address_weak_equal(a,b)) {
/*also check both transport and uri */
if (linphone_address_is_secure(a) == linphone_address_is_secure(b) && linphone_address_get_transport(a) == linphone_address_get_transport(b))
if (linphone_address_get_secure(a) == linphone_address_get_secure(b) && linphone_address_get_transport(a) == linphone_address_get_transport(b))
return LinphoneProxyConfigAddressWeakEqual;
else
return LinphoneProxyConfigAddressDifferent;
......@@ -78,7 +78,7 @@ LinphoneProxyConfigAddressComparisonResult linphone_proxy_config_is_server_confi
if (result == LinphoneProxyConfigAddressEqual) result = result_identity;
end:
if (current_proxy) linphone_address_destroy(current_proxy);
if (current_proxy) linphone_address_unref(current_proxy);
ms_message("linphone_proxy_config_is_server_config_changed : %i", result);
return result;
}
......@@ -208,7 +208,7 @@ void _linphone_proxy_config_release_ops(LinphoneProxyConfig *cfg){
void _linphone_proxy_config_destroy(LinphoneProxyConfig *cfg){
if (cfg->reg_proxy!=NULL) ms_free(cfg->reg_proxy);
if (cfg->reg_identity!=NULL) ms_free(cfg->reg_identity);
if (cfg->identity_address!=NULL) linphone_address_destroy(cfg->identity_address);
if (cfg->identity_address!=NULL) linphone_address_unref(cfg->identity_address);
if (cfg->reg_route!=NULL) ms_free(cfg->reg_route);
if (cfg->quality_reporting_collector!=NULL) ms_free(cfg->quality_reporting_collector);
if (cfg->ssctx!=NULL) sip_setup_context_free(cfg->ssctx);
......@@ -217,8 +217,8 @@ void _linphone_proxy_config_destroy(LinphoneProxyConfig *cfg){
if (cfg->dial_prefix!=NULL) ms_free(cfg->dial_prefix);
if (cfg->contact_params) ms_free(cfg->contact_params);
if (cfg->contact_uri_params) ms_free(cfg->contact_uri_params);
if (cfg->saved_proxy!=NULL) linphone_address_destroy(cfg->saved_proxy);
if (cfg->saved_identity!=NULL) linphone_address_destroy(cfg->saved_identity);
if (cfg->saved_proxy!=NULL) linphone_address_unref(cfg->saved_proxy);
if (cfg->saved_identity!=NULL) linphone_address_unref(cfg->saved_identity);
if (cfg->sent_headers!=NULL) sal_custom_header_free(cfg->sent_headers);
if (cfg->pending_contact) linphone_address_unref(cfg->pending_contact);
if (cfg->refkey) ms_free(cfg->refkey);
......@@ -267,7 +267,7 @@ int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *cfg, const char *
addr=linphone_address_new(server_addr);
if (addr){
cfg->reg_proxy=linphone_address_as_string(addr);
linphone_address_destroy(addr);
linphone_address_unref(addr);
}else{
ms_warning("Could not parse %s",server_addr);
return -1;
......@@ -285,7 +285,7 @@ int linphone_proxy_config_set_identity_address(LinphoneProxyConfig *cfg, const L
return -1;
}
if (cfg->identity_address != NULL) {
linphone_address_destroy(cfg->identity_address);
linphone_address_unref(cfg->identity_address);
}
cfg->identity_address=linphone_address_clone(addr);
......@@ -300,7 +300,7 @@ int linphone_proxy_config_set_identity(LinphoneProxyConfig *cfg, const char *ide
if (identity!=NULL && strlen(identity)>0){
LinphoneAddress *addr=linphone_address_new(identity);
int ret=linphone_proxy_config_set_identity_address(cfg, addr);
if (addr) linphone_address_destroy(addr);
if (addr) linphone_address_unref(addr);
return ret;
}
return -1;
......@@ -446,7 +446,7 @@ LinphoneAddress *guess_contact_for_register(LinphoneProxyConfig *cfg){
ret=contact;
}
linphone_address_destroy(proxy);
linphone_address_unref(proxy);
return ret;
}
......@@ -465,7 +465,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){
LinphoneAddress *contact;
ms_message("LinphoneProxyConfig [%p] about to register (LinphoneCore version: %s)",cfg,linphone_core_get_version());
proxy_string=linphone_address_as_string_uri_only(proxy);
linphone_address_destroy(proxy);
linphone_address_unref(proxy);
if (cfg->op)
sal_op_release(cfg->op);
cfg->op=sal_op_new(cfg->lc->sal);
......@@ -474,7 +474,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){
if ((contact=guess_contact_for_register(cfg))) {
sal_op_set_contact_address(cfg->op,contact);
linphone_address_destroy(contact);
linphone_address_unref(contact);
}
sal_op_set_user_pointer(cfg->op,cfg);
......@@ -558,7 +558,7 @@ void linphone_proxy_config_set_quality_reporting_collector(LinphoneProxyConfig *
}
if (addr){
linphone_address_destroy(addr);
linphone_address_unref(addr);
}
}
}
......@@ -693,7 +693,7 @@ static LinphoneAddress* _linphone_core_destroy_addr_if_not_sip( LinphoneAddress*
if( linphone_address_is_sip(addr) ) {
return addr;
} else {
linphone_address_destroy(addr);
linphone_address_unref(addr);
return NULL;
}
}
......
......@@ -380,7 +380,7 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report,
STR_REASSIGN(report->qos_analyzer.output, NULL);
}
linphone_address_destroy(request_uri);
linphone_address_unref(request_uri);
linphone_content_unref(content);
end:
......
......@@ -73,7 +73,7 @@ static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char
linphone_proxy_config_enable_register(cfg,TRUE);
linphone_proxy_config_done(cfg);
ms_free(tmp);
linphone_address_destroy(parsed_uri);
linphone_address_unref(parsed_uri);
ms_message("SipLogin: done");
return 0;
}
......
......@@ -150,7 +150,7 @@ int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, cons
}
strncpy(ctx->domain,linphone_address_get_domain(from),sizeof(ctx->domain));
strncpy(ctx->username,linphone_address_get_username(from),sizeof(ctx->username));
linphone_address_destroy(from);
linphone_address_unref(from);
if (ctx->funcs->login_account)
return ctx->funcs->login_account(ctx,uri,passwd,userid);
return -1;
......
......@@ -71,7 +71,7 @@ void RegisterCommand::exec(Daemon *app, const string& args) {
if (from != NULL) {
LinphoneAuthInfo *info = linphone_auth_info_new(linphone_address_get_username(from), cuserid, cpassword, NULL, crealm, NULL);
linphone_core_add_auth_info(lc, info); /* Add authentication info to LinphoneCore */
linphone_address_destroy(from);
linphone_address_unref(from);
linphone_auth_info_destroy(info);
}
}
......
......@@ -878,7 +878,7 @@ Daemon::~Daemon() {
}
enableLSD(false);
linphone_core_destroy(mLc);
linphone_core_unref(mLc);
if (mChildFd != (ortp_pipe_t)-1) {
ortp_server_pipe_close_client(mChildFd);
}
......
......@@ -307,7 +307,7 @@ static gboolean grab_focus(GtkWidget *w){
void linphone_gtk_friend_list_set_active_address(const LinphoneAddress *addr){
GtkWidget *w=linphone_gtk_get_main_window();
GtkWidget *friendlist=linphone_gtk_get_widget(w,"contact_list");
g_object_set_data_full(G_OBJECT(friendlist),"from", addr ? linphone_address_clone(addr) : NULL, (GDestroyNotify)linphone_address_destroy);
g_object_set_data_full(G_OBJECT(friendlist),"from", addr ? linphone_address_clone(addr) : NULL, (GDestroyNotify)linphone_address_unref);
}
const LinphoneAddress *linphone_gtk_friend_list_get_active_address(void){
......@@ -516,7 +516,7 @@ static void icon_press_handler(GtkEntry *entry){
linphone_friend_set_address(lf,addr);
linphone_gtk_show_contact(lf, w);
}
linphone_address_destroy(addr);
linphone_address_unref(addr);
}
}
......@@ -879,7 +879,7 @@ void linphone_gtk_contact_ok(GtkWidget *button){
linphone_core_add_friend(linphone_gtk_get_core(),lf);
}
}
linphone_address_destroy(friend_address);
linphone_address_unref(friend_address);
linphone_gtk_show_friends();
gtk_widget_destroy(w);
}
......
......@@ -465,7 +465,7 @@ static void video_button_clicked(GtkWidget *button, LinphoneCall *call){
gtk_widget_set_sensitive(button,FALSE);
linphone_call_params_enable_video(params, adding);