From: Patrik Flykt Date: Fri, 7 Sep 2012 08:00:57 +0000 (+0300) Subject: wispr: Add backpointer to wispr portal structure X-Git-Tag: 1.7~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=217953cba7bb716e5cc8c95b6dd5c93d99385439;p=platform%2Fupstream%2Fconnman.git 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. --- diff --git a/src/wispr.c b/src/wispr.c index f08fa7f..7ff111a 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;