diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2010-08-30 18:21:11 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-09-08 20:06:23 +0200 |
commit | 59ed26199c1e75a2df37391acfb53bf83b02c85b (patch) | |
tree | 64950e026038a61424d842695ff52541b87f8d6f | |
parent | d148b34ed293d35a67b7a04a1f37128770c83f60 (diff) | |
download | connman-59ed26199c1e75a2df37391acfb53bf83b02c85b.tar.gz connman-59ed26199c1e75a2df37391acfb53bf83b02c85b.tar.bz2 connman-59ed26199c1e75a2df37391acfb53bf83b02c85b.zip |
network: don't add into profile while unregistered
The connman_network_set_group() created an extra ref to service if it
was called before network was probed and registered.
-rw-r--r-- | src/network.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/network.c b/src/network.c index a74043c7..68769e41 100644 --- a/src/network.c +++ b/src/network.c @@ -534,21 +534,24 @@ void connman_network_set_group(struct connman_network *network, } if (g_strcmp0(network->group, group) == 0) { - if (group != NULL) + if (group != NULL && network->registered) __connman_profile_update_network(network); return; } if (network->group != NULL) { - __connman_profile_remove_network(network); + if (network->registered) + __connman_profile_remove_network(network); g_free(network->group); } network->group = g_strdup(group); - if (network->group != NULL) - __connman_profile_add_network(network); + if (network->group != NULL) { + if (network->registered) + __connman_profile_add_network(network); + } } /** @@ -1745,7 +1748,8 @@ static void network_remove(struct connman_element *element) case CONNMAN_NETWORK_TYPE_WIFI: case CONNMAN_NETWORK_TYPE_WIMAX: if (network->group != NULL) { - __connman_profile_remove_network(network); + if (network->registered) + __connman_profile_remove_network(network); g_free(network->group); network->group = NULL; |