wispr: Reference count service properly according to contexts
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mon, 17 Oct 2011 13:51:32 +0000 (16:51 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 20 Oct 2011 22:26:26 +0000 (00:26 +0200)
src/wispr.c

index d97aaeb..0e05f9d 100644 (file)
@@ -120,6 +120,8 @@ static void free_connman_wispr_portal_context(struct connman_wispr_portal_contex
        if (wp_context == NULL)
                return;
 
+       connman_service_unref(wp_context->service);
+
        if (wp_context->token > 0)
                connman_proxy_lookup_cancel(wp_context->token);
 
@@ -721,6 +723,8 @@ int __connman_wispr_start(struct connman_service *service,
        if (wp_context == NULL)
                return -ENOMEM;
 
+       connman_service_ref(service);
+
        wp_context->service = service;
        wp_context->type = type;