summaryrefslogtreecommitdiff
path: root/src/profile.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-17 14:51:52 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-07-17 14:51:52 +0200
commit97e2d1e0c7017e3d076d076596bb0ab3a79cbce8 (patch)
tree0606ccd297f03c98d499b9a76dcb82c72504a32e /src/profile.c
parent252c323a8f74d552973b3ec98c4898d920b94d68 (diff)
downloadconnman-97e2d1e0c7017e3d076d076596bb0ab3a79cbce8.tar.gz
connman-97e2d1e0c7017e3d076d076596bb0ab3a79cbce8.tar.bz2
connman-97e2d1e0c7017e3d076d076596bb0ab3a79cbce8.zip
Fix reference counting with multiple networks with same SSID
Diffstat (limited to 'src/profile.c')
-rw-r--r--src/profile.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/profile.c b/src/profile.c
index 1fd3068d..ca316ed2 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -133,17 +133,9 @@ int __connman_profile_add_device(struct connman_device *device)
int __connman_profile_remove_device(struct connman_device *device)
{
- struct connman_service *service;
-
DBG("device %p", device);
- service = __connman_service_lookup_from_device(device);
- if (service == NULL)
- return -EINVAL;
-
- __connman_service_disconnect(service);
-
- __connman_service_put(service);
+ __connman_service_remove_from_device(device);
return 0;
}
@@ -163,17 +155,9 @@ int __connman_profile_add_network(struct connman_network *network)
int __connman_profile_remove_network(struct connman_network *network)
{
- struct connman_service *service;
-
DBG("network %p", network);
- service = __connman_service_lookup_from_network(network);
- if (service == NULL)
- return -EINVAL;
-
- __connman_service_disconnect(service);
-
- __connman_service_put(service);
+ __connman_service_remove_from_network(network);
return 0;
}