[gupnp] Unref root device in ACL server handler



commit 8fdd98c381d4c7ddc8d14c90a09e244a0827ab00
Author: Jens Georg <mail jensge org>
Date:   Sun May 25 11:00:41 2014 +0200

    Unref root device in ACL server handler
    
    We have an indirect reference through handler->service, so no need to
    keep around the one added through g_object_get.
    
    This fixes the case where test-bugs randomly ran into timeouts because it
    subscribed to the wrong service on the wrong (dangling) device.
    
    Signed-off-by: Jens Georg <mail jensge org>

 libgupnp/gupnp-context.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index d7c0433..b942369 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -1393,6 +1393,10 @@ gupnp_acl_server_handler (SoupServer *server,
                 g_object_get (handler->service,
                               "root-device", &device,
                               NULL);
+
+                if (device != NULL) {
+                        g_object_unref (device);
+                }
         }
 
         agent = soup_message_headers_get_one (msg->request_headers,


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