[gupnp] context: Small code cleanup
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp] context: Small code cleanup
- Date: Thu, 20 May 2021 10:57:08 +0000 (UTC)
commit 35bba25ca93701e330ea258f15f0310f11b27774
Author: Jens Georg <mail jensge org>
Date: Wed May 19 19:43:46 2021 +0200
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]