From: Jukka Rissanen Date: Tue, 20 Mar 2012 10:37:57 +0000 (+0200) Subject: vpn: Unref provider properly X-Git-Tag: 0.80~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=18fdec1d5e9419620d51619fc5614f0c90bfecd7;p=platform%2Fupstream%2Fconnman.git vpn: Unref provider properly The provider can be unreffed in vpn_died() or in vpn_disconnect(). We must do the unref only once. --- diff --git a/plugins/vpn.c b/plugins/vpn.c index 7a35f7a..e41a374 100644 --- a/plugins/vpn.c +++ b/plugins/vpn.c @@ -134,8 +134,12 @@ void vpn_died(struct connman_task *task, int exit_code, void *user_data) stop_vpn(provider); connman_provider_set_data(provider, NULL); - connman_provider_unref(provider); - connman_rtnl_remove_watch(data->watch); + + if (data->watch != 0) { + connman_provider_unref(provider); + connman_rtnl_remove_watch(data->watch); + data->watch = 0; + } vpn_exit: if (state != VPN_STATE_READY && state != VPN_STATE_DISCONNECT) {