41 lines
1.3 KiB
Diff
41 lines
1.3 KiB
Diff
From 35bba25ca93701e330ea258f15f0310f11b27774 Mon Sep 17 00:00:00 2001
|
|
From: Jens Georg <mail@jensge.org>
|
|
Date: Wed, 19 May 2021 19:43:46 +0200
|
|
Subject: [PATCH] context: Small code cleanup
|
|
|
|
---
|
|
libgupnp/gupnp-context.c | 10 ++--------
|
|
1 file changed, 2 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
|
|
index 460179e..58d3abf 100644
|
|
--- a/libgupnp/gupnp-context.c
|
|
+++ b/libgupnp/gupnp-context.c
|
|
@@ -331,10 +331,7 @@ gupnp_context_dispose (GObject *object)
|
|
context = GUPNP_CONTEXT (object);
|
|
priv = gupnp_context_get_instance_private (context);
|
|
|
|
- if (priv->session) {
|
|
- g_object_unref (priv->session);
|
|
- priv->session = NULL;
|
|
- }
|
|
+ g_clear_object (&priv->session);
|
|
|
|
while (priv->host_path_datas) {
|
|
HostPathData *data;
|
|
@@ -344,10 +341,7 @@ gupnp_context_dispose (GObject *object)
|
|
gupnp_context_unhost_path (context, data->server_path);
|
|
}
|
|
|
|
- if (priv->server) {
|
|
- g_object_unref (priv->server);
|
|
- priv->server = NULL;
|
|
- }
|
|
+ g_clear_object (&priv->server);
|
|
|
|
/* Call super */
|
|
object_class = G_OBJECT_CLASS (gupnp_context_parent_class);
|
|
--
|
|
2.27.0
|
|
|