diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-09-07 11:00:57 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-09-11 12:40:58 +0300 |
commit | 217953cba7bb716e5cc8c95b6dd5c93d99385439 (patch) | |
tree | 6c12b2f2b84fafbbb94f8104f25f755a5fc58fd0 | |
parent | d5a98f2fd1970aec2ea73c95da73d9ecd0c15d33 (diff) | |
download | connman-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.
-rw-r--r-- | src/wispr.c | 10 |
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; |