[gupnp] acl: Don't keep reference of the service



commit 3e4f29b1fe2e9e4a7b72b5fe98f9c76f753ee167
Author: Jens Georg <mail jensge org>
Date:   Sun Jan 4 12:56:35 2015 +0100

    acl: Don't keep reference of the service
    
    The handler will live at least as long as the service since it's bound to the
    context so there is no need to keep a reference of it.
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742075

 libgupnp/gupnp-acl.c     |    4 ++--
 libgupnp/gupnp-service.c |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libgupnp/gupnp-acl.c b/libgupnp/gupnp-acl.c
index 9ee6340..387d003 100644
--- a/libgupnp/gupnp-acl.c
+++ b/libgupnp/gupnp-acl.c
@@ -206,8 +206,8 @@ acl_server_handler_new (GUPnPService *service,
 void
 acl_server_handler_free (AclServerHandler *handler)
 {
-        g_clear_pointer (&handler->service, NULL);
-        g_clear_pointer (&handler->context, NULL);
+        handler->service = NULL;
+        handler->context = NULL;
 
         if (handler->notify != NULL)
                 handler->notify (handler->user_data);
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index fbccdb7..54372b7 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -1463,8 +1463,8 @@ gupnp_service_constructor (GType                  type,
         handler = acl_server_handler_new (GUPNP_SERVICE (object),
                                           context,
                                           control_server_handler,
-                                          g_object_ref (object),
-                                          g_object_unref);
+                                          object,
+                                          NULL);
         _gupnp_context_add_server_handler_with_data (context, path, handler);
         g_free (path);
         g_free (url);
@@ -1475,8 +1475,8 @@ gupnp_service_constructor (GType                  type,
         handler = acl_server_handler_new (GUPNP_SERVICE (object),
                                           context,
                                           subscription_server_handler,
-                                          g_object_ref (object),
-                                          g_object_unref);
+                                          object,
+                                          NULL);
         _gupnp_context_add_server_handler_with_data (context, path, handler);
         g_free (path);
         g_free (url);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]