summaryrefslogtreecommitdiff
path: root/src/wispr.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-09-07 11:00:57 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-09-11 12:40:58 +0300
commit217953cba7bb716e5cc8c95b6dd5c93d99385439 (patch)
tree6c12b2f2b84fafbbb94f8104f25f755a5fc58fd0 /src/wispr.c
parentd5a98f2fd1970aec2ea73c95da73d9ecd0c15d33 (diff)
downloadconnman-217953cba7bb716e5cc8c95b6dd5c93d99385439.tar.gz
connman-217953cba7bb716e5cc8c95b6dd5c93d99385439.tar.bz2
connman-217953cba7bb716e5cc8c95b6dd5c93d99385439.zip
wispr: Add backpointer to wispr portal structure
When calling free_connman_wispr_portal_context(), the context is freed. Add a backpointer to the wispr portal context in order to clear the context from the wispr_portal struct.
Diffstat (limited to 'src/wispr.c')
-rw-r--r--src/wispr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wispr.c b/src/wispr.c
index f08fa7f3..7ff111a0 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -69,6 +69,7 @@ struct connman_wispr_portal_context {
struct connman_service *service;
enum connman_ipconfig_type type;
+ struct connman_wispr_portal *wispr_portal;
/* Portal/WISPr common */
GWeb *web;
@@ -167,6 +168,14 @@ static void free_connman_wispr_portal_context(struct connman_wispr_portal_contex
if (wp_context == NULL)
return;
+ if (wp_context->wispr_portal != NULL) {
+ if (wp_context->wispr_portal->ipv4_context == wp_context)
+ wp_context->wispr_portal->ipv4_context = NULL;
+
+ if (wp_context->wispr_portal->ipv6_context == wp_context)
+ wp_context->wispr_portal->ipv6_context = NULL;
+ }
+
if (wp_context->service != NULL)
connman_service_unref(wp_context->service);
@@ -1015,6 +1024,7 @@ int __connman_wispr_start(struct connman_service *service,
wp_context->service = service;
wp_context->type = type;
+ wp_context->wispr_portal = wispr_portal;
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
wispr_portal->ipv4_context = wp_context;