projects
/
framework
/
connectivity
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
791e462
)
vpn: Unref provider properly
author
Jukka Rissanen
<jukka.rissanen@linux.intel.com>
Tue, 20 Mar 2012 10:37:57 +0000
(12:37 +0200)
committer
Patrik Flykt
<patrik.flykt@linux.intel.com>
Tue, 27 Mar 2012 09:54:35 +0000
(12:54 +0300)
The provider can be unreffed in vpn_died() or in vpn_disconnect().
We must do the unref only once.
plugins/vpn.c
patch
|
blob
|
history
diff --git
a/plugins/vpn.c
b/plugins/vpn.c
index
7a35f7a
..
e41a374
100644
(file)
--- 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) {