[gupnp/wip/phako/libsoup3] Context: Unref server if listen fails



commit 3083640883bba8668b462242cfa2e49dd0669895
Author: Jens Georg <mail jensge org>
Date:   Sun Nov 21 16:25:47 2021 +0100

    Context: Unref server if listen fails
    
    So that g_initable_new fails properly

 libgupnp/gupnp-context.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index 0d37269..b8214a1 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -540,7 +540,8 @@ gupnp_context_get_server (GUPnPContext *context)
 
                 if (! soup_server_listen (priv->server,
                                           addr, (SoupServerListenOptions) 0, &error)) {
-                        g_warning ("GUPnPContext: Unable to listen on %s:%u %s", ip, port, error->message);
+                        g_clear_object (&priv->server);
+                        g_warning ("Unable to listen on %s:%u %s", ip, port, error->message);
                         g_error_free (error);
                 }
 


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