]> sjero.net Git - linphone/blobdiff - coreapi/proxy.c
fix: avoid giving LinphoneRegistration* notifications for removed proxy config
[linphone] / coreapi / proxy.c
index 18999dae0bfe7895fe165cd3b498536da240186a..433d68c5adba416c30f6157b2ad1b8e71893dbc2 100644 (file)
@@ -547,8 +547,10 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf
        /* add to the list of destroyed proxies, so that the possible unREGISTER request can succeed authentication */
        lc->sip_conf.deleted_proxies=ms_list_append(lc->sip_conf.deleted_proxies,(void *)cfg);
        cfg->deletion_date=ms_time(NULL);
-       /* this will unREGISTER */
-       linphone_proxy_config_edit(cfg);
+       if (cfg->state==LinphoneRegistrationOk){
+               /* this will unREGISTER */
+               linphone_proxy_config_edit(cfg);
+       }
        if (lc->default_proxy==cfg){
                lc->default_proxy=NULL;
        }