From 1c65859d639d76e160ab2fe1fe53bf269df084b7 Mon Sep 17 00:00:00 2001 From: linker99 Date: Tue, 31 Oct 2023 09:17:07 +0800 Subject: [PATCH] context: Small code cleanup --- context-Small-code-cleanup.patch | 40 ++++++++++++++++++++++++++++++++ gupnp.spec | 6 ++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 context-Small-code-cleanup.patch diff --git a/context-Small-code-cleanup.patch b/context-Small-code-cleanup.patch new file mode 100644 index 0000000..33af92e --- /dev/null +++ b/context-Small-code-cleanup.patch @@ -0,0 +1,40 @@ +From 35bba25ca93701e330ea258f15f0310f11b27774 Mon Sep 17 00:00:00 2001 +From: Jens Georg +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 + diff --git a/gupnp.spec b/gupnp.spec index 4aba16f..db5eeed 100644 --- a/gupnp.spec +++ b/gupnp.spec @@ -1,6 +1,6 @@ Name: gupnp Version: 1.2.4 -Release: 5 +Release: 6 Summary: UPnP devices & control points creation framework License: LGPLv2+ URL: http://www.gupnp.org/ @@ -10,6 +10,7 @@ Patch1: ServiceProxy-Remove-bogos-function-rename.patch Patch2: linux-cm-Fds-can-be-0.patch Patch3: service-action-Protect-against-unsent-message-use.patch Patch4: service-action-Do-not-leak-message-if-never-sent.patch +Patch5: context-Small-code-cleanup.patch BuildRequires: gssdp-devel >= 1.2.3 gtk-doc gobject-introspection-devel >= 1.36 BuildRequires: libsoup-devel libxml2-devel libuuid-devel vala meson @@ -78,6 +79,9 @@ This package contains help file and developer documentation for gupnp. %{_mandir}/man1/gupnp-binding-tool-* %changelog +* Thu Nov 23 2023 fandehui - 1.2.4-6 +- context: Small code cleanup + * Thu Nov 9 2023 fandehui - 1.2.4-5 - service-action: Do not leak message if never sent